1. Project Setup
2. Define Schemas
Each Zod schema passed tocreateSmithers becomes a named, auto-created SQLite output table.
outputs provides typed references (outputs.analysis instead of the string "analysis"). Typos become compile errors. runId, nodeId, and iteration columns are auto-added.
3. Configure Agents
This example uses the Vercel AI SDK with Anthropic Claude models.4. Build the Workflow
ctx.outputMaybe()returnsundefineduntil the task completes. Safe for reactive control flow.{analysis ? <Task .../> : null}gates downstream tasks on upstream completion inside a Sequence.ctx.inputis the runtime input object (here:{ repo: string, focusArea?: string }). See the data model.
5. Create the Runner
report rather than output, result.output stays undefined. Rename that schema key to output if you want runWorkflow() to return it directly.
6. Run It
main.ts needed):
7. Inspect Results
Execution Model
The engine renders the JSX tree repeatedly, following the execution model:- Render 1 — Only
analyzeis mounted. Engine executes it. - Render 2 —
ctx.outputMaybe(outputs.analysis)returns data.fixmounts and executes. - Render 3 — Both outputs available.
reportmounts and executes. - Render 4 — All tasks finished. Run completes.
Adding Tools
Next Steps
- Run Workflow — Runner API options and result handling.
- CLI Quickstart — Run, inspect, and resume workflows from the CLI.
- Structured Output — Schema validation in depth.
- Error Handling — Retries, timeouts, fallback paths.
- Resumability — Crash recovery and deterministic replay.
- Patterns — Project structure for larger workflows.