Workflow Examples
Ready-to-adapt
.workflow.mdexamples — copy one into your workspace and edit it in the text or canvas view.
Webhook-triggered workflow
Responds to a GitHub issues.opened webhook, posts an alert to Slack, then files a Jira ticket.
markdown
=== Workflow: IssueResponder ===
Monitor GitHub issues and send alerts to Slack channel
**Triggers**: GitHub webhook (issues.opened)
**Context**: slack_channel=#bugs
**Workflow**:
**Step 1**: Setup
- [-] Setup GitHub webhook @endpoint SetupWebhook
- [-] Configure Slack integration @endpoint ConfigureSlack
**Step 2**: Send Alert
- [ ] Send alert to Slack @endpoint SlackSendMessage
Input:
- channel={context.slack_channel}
Output:
- message_id
**Step 3**: Create Ticket
- [ ] Create Jira ticket @endpoint CreateJiraTicket
Input:
- issue_data={extract:issue}
Output:
- ticket_id
## @auth SlackOAuth
type: oauth2
service: slack
scope: chat:write,channels:read
## @auth GitHubToken
type: oauth2
service: github
scope: repo,webhooks
## @auth JiraBasic
type: basic
service: jira
## @endpoint SetupWebhook
POST https://api.github.com/repos/{owner}/{repo}/hooks
Auth: GitHubToken
Body:
- events: array
- url: string
## @endpoint ConfigureSlack
POST https://slack.com/api/conversations.join
Auth: SlackOAuth
Body:
- channel: string
## @endpoint SlackSendMessage
POST https://slack.com/api/chat.postMessage
Auth: SlackOAuth
Body:
- channel: string
- text: string
- blocks: array
## @endpoint CreateJiraTicket
POST https://api.atlassian.com/jira/rest/api/3/issue
Auth: JiraBasic
Body:
- project:
- key: string
- summary: string
- description: string
- issuetype:
- name: string
Cron-scheduled workflow
Runs every morning at 09:00, collects metrics, generates a summary, posts it to Slack, and updates a dashboard.
markdown
=== Workflow: DailySummary ===
Generate daily project summary and send to team
**Triggers**: Cron (0 9 * * *)
**Context**: report_channel=#updates, timezone=Asia/Tokyo
**Workflow**:
**Step 1**: Fetch Metrics
- [ ] Fetch project metrics @endpoint GetMetrics
Output:
- total_users
- active_sessions
- revenue
**Step 2**: Generate Report
- [ ] Generate summary report @endpoint GenerateReport
Input:
- metrics={step1.total_users}
Output:
- report_id
- report_content
**Step 3**: Send to Slack
- [ ] Send to Slack channel @endpoint SlackSendMessage
Input:
- report={step2.report_content}
Output:
- message_id
**Step 4**: Update Dashboard
- [ ] Update dashboard @endpoint UpdateDashboard
Input:
- metrics={step1}
Output:
- dashboard_id
## @auth MetricsAPI
type: api_key
service: metrics_provider
## @auth SlackOAuth
type: oauth2
service: slack
scope: chat:write,channels:read
## @endpoint GetMetrics
GET https://api.example.com/metrics
Auth: MetricsAPI
Response:
- total_users: number
- active_sessions: number
- revenue: number
## @endpoint GenerateReport
POST https://api.example.com/reports/generate
Auth: MetricsAPI
Body:
- metrics: object
## @endpoint SlackSendMessage
POST https://slack.com/api/chat.postMessage
Auth: SlackOAuth
Body:
- channel: string
- text: string
- blocks: array
## @endpoint UpdateDashboard
POST https://api.example.com/dashboard/update
Auth: MetricsAPI
Body:
- metrics: object
- timestamp: string
Multi-step pipeline
A longer workflow with a running step — setup done, data-flow test in progress, scheduling and monitoring still pending.
markdown
=== Workflow: DataPipeline ===
Automate daily data collection, processing, and reporting workflow
**Triggers**: Cron (0 8 * * *)
**Context**: timezone=Asia/Tokyo, monitoring_enabled=true
**Workflow**:
**Step 1**: Setup
- [-] Configure data sources @endpoint ConfigureDataSources
- [-] Set up processing pipeline @endpoint SetupPipeline
**Step 2**: Test
- [~] Test data flow @endpoint TestDataFlow
Input:
- source={context.source}
Output:
- test_results
**Step 3**: Schedule
- [ ] Schedule daily execution @endpoint ScheduleCronJob
Input:
- schedule={context.schedule}
Output:
- job_id
**Step 4**: Monitoring
- [ ] Set up monitoring alerts @endpoint CreateAlert
Input:
- severity=high
- source=data-pipeline
Output:
- alert_id
## @auth PipelineAPI
type: api_key
service: data_pipeline
## @endpoint ConfigureDataSources
POST https://api.example.com/data-sources/configure
Auth: PipelineAPI
Body:
- sources: array
## @endpoint SetupPipeline
POST https://api.example.com/pipeline/setup
Auth: PipelineAPI
Body:
- config: object
## @endpoint TestDataFlow
POST https://api.example.com/test
Auth: PipelineAPI
Body:
- source: string
## @endpoint ScheduleCronJob
POST https://api.example.com/cron
Auth: PipelineAPI
Body:
- schedule: string
- timezone: string
## @endpoint CreateAlert
POST https://api.example.com/alerts
Auth: PipelineAPI
Body:
- severity: string
- message: string
- source: string
Human approval gate
@checkpoint pauses the run until a human approves — use it for destructive steps like production deploys.
markdown
=== Workflow: ProductionDeployment ===
Deploy to production with human approval checkpoint
**Triggers**: GitHub webhook (release.published)
**Context**: deploy_channel=#deployments
**Workflow**:
**Step 1**: Run Tests
- [ ] Run tests @endpoint RunTests
Output:
- test_results
- passed
**Step 2**: Deploy
- [ ] Deploy to production @endpoint DeployToProd
Input:
- environment=production
Output:
- deployment_url
**Step 3**: Verify Deployment
- [ ] Verify deployment @checkpoint VerifyDeployment
Input:
- deployment_url={step2.deployment_url}
Output:
- approved
- notes
- deployment_url
**Step 4**: Notify Team
- [ ] Notify team @endpoint NotifyTeam
Input:
- deployment_url={checkpoint.deployment_url}
Output:
- message_id
## @auth GitHubToken
type: oauth2
service: github
scope: repo,workflow
## @auth SlackOAuth
type: oauth2
service: slack
scope: chat:write,channels:read
## @endpoint RunTests
POST https://api.example.com/tests
Auth: GitHubToken
Body:
- branch: string
## @endpoint DeployToProd
POST https://api.example.com/deploy
Auth: GitHubToken
Body:
- environment: production
## @checkpoint VerifyDeployment
> Deployment approval required
- [ ] Tests passed
- [ ] Deployment successful
- [ ] No critical errors
Approver: @workflow
Output: approved, notes, deployment_url
## @endpoint NotifyTeam
POST https://slack.com/api/chat.postMessage
Auth: SlackOAuth
Body:
- channel: "#deployments"
- text: string
Status markers
| Marker | Meaning |
|---|---|
[ ] | Pending — not started |
[~] | Running — currently executing |
[-] or [x] | Completed |