Your first workflow
The quickest path is zen workflow run zen-workflow-builder followed by an English description. The builder writes the YAML for you. This page is the other path: writing the file yourself so you understand what's actually going on.
The smallest useful workflow
Create a file at .zen/workflows/morning-brief.yaml:
name: morning-brief
description: Summarize what's new in Slack since yesterday.
nodes:
- id: pull-slack
type: prompt
prompt: |
Summarize unread messages from #team and #leadership since yesterday 6pm.
Quote anyone who tagged me. Five bullets max.One node, one prompt. Fire it:
zen workflow run morning-briefThe output prints to your terminal. Z.E.N. also writes a run row to its local database so you can find the same output later via zen run logs or in the Dashboard.
Add a second step
A workflow with one step is just a saved prompt. The real value shows up when you chain steps together. Add a Notion node and a combine node:
name: morning-brief
description: Summarize what's new in Slack and Notion since yesterday.
nodes:
- id: pull-slack
type: prompt
prompt: |
Summarize unread messages from #team and #leadership since yesterday 6pm.
Quote anyone who tagged me.
- id: pull-notion
type: prompt
prompt: |
Find pages edited in the last 24 hours under Strategy and Product.
Return titles plus a one-line summary each.
- id: combine
type: prompt
depends_on: [pull-slack, pull-notion]
prompt: |
Combine the Slack summary and the Notion edits into a single brief.
Headline at top, sections below.The two pull- nodes don't depend on each other, so Z.E.N. runs them in parallel. The combine node waits for both before it starts. The output of combine is the workflow's final output.
Make it routine
A workflow you have to fire manually every morning is a workflow you'll stop firing in two weeks. Add a schedule and forget about it:
name: morning-brief
description: Summarize what's new in Slack and Notion since yesterday.
schedule:
cron: "0 7 * * 1-5"
timezone: "America/New_York"
# ...nodes as beforeCron syntax, weekdays at 7 a.m. Eastern. Z.E.N. fires this whether you're at the keyboard or not, as long as the daemon is running. See Schedules for the catch-up rules when your machine sleeps through a fire.
Where to put the output
A node's output goes to the next node by default. If you want it to land somewhere external (email, Notion page, Slack DM), the last node calls the right tool:
- id: send-email
type: prompt
depends_on: [combine]
prompt: |
Send the combined brief to me@example.com with the subject "Morning brief".That requires an email connector wired into the workflow. See Integrations for what ships out of the box.
Don't write workflows by hand if you don't want to
The builder workflow is real: zen workflow run zen-workflow-builder "describe what you want" produces a YAML file you can read, edit, and rerun. Most people use the builder for the first version and then hand-edit when they want a specific change. Both paths are valid.
Next
- Author a workflow for the full set of node types, variables, and dependency patterns.
- Schedules for cron, timezones, and catch-up math.
- Integrations for the connectors you can wire into your workflows.