<Workflow>, <Task>, and control-flow components, and Smithers renders that tree into an execution plan.
Use JSX when you want:
- component composition and reusable workflow fragments
- explicit control-flow nodes like
<Approval>,<Parallel>,<MergeQueue>, and<Worktree> - render-time branching driven by
ctx.outputMaybe(...) - MDX prompt templates
- a TSX-first workflow authoring model
What JSX Looks Like
outputs object returned by createSmithers maps each schema key to its Zod schema. Passing output={outputs.analysis} instead of a magic string gives you compile-time type checking — a typo like output={outputs.anaylsis} is a type error, not a runtime surprise.
How JSX Execution Works
The JSX API is render-driven:- Smithers renders the workflow tree with the current
ctx. - It extracts executable task descriptors from the rendered tree.
- It runs the ready tasks and persists their outputs.
- It renders again with the updated outputs in
ctx.
Two Common JSX Styles
Schema-driven JSX
UsecreateSmithers(...) with Zod schemas and the returned outputs object. This is the fastest JSX path and the best default for new workflows. The output prop is type-checked against the registered schemas.
Manual JSX
Usesmithers(db, build) with explicit Drizzle table objects when you want lower-level control over persistence.
Both styles compile to the same JSX renderer and execution engine.
How It Relates to the Other APIs
- TOON is the declarative path. It is better when prompts are the main thing you are authoring.
- Effect Builder is the low-level typed graph API. It is better when you want explicit step handles and heavy
Layercomposition. - JSX sits in the middle: more dynamic than TOON, less explicit than the Effect builder.
Next Steps
- JSX Installation — Set up TypeScript, TSX, and optional MDX prompts.
- JSX Quickstart — Build a two-step workflow.
- Approval — Add a first-class approval node to the graph.
- MergeQueue — Serialize a subtree with a concurrency cap.
- Workflow — Start with the root component reference.