Workflows overview
Declarative multi-step agent DAGs with attenuated subagents.
A workflow is a declarative multi-step agent pipeline: a dependency DAG of steps, each delegated to an isolated, capability-attenuated subagent, with every step audited and (in streaming mode) resumable.
Source: docs/workflows.md. Schema: protocol/schemas/workflow-graph.schema.json.
Topology
Section titled “Topology”flowchart TD scan["scan / scout"] --> bugs["bugs / reviewer"] scan --> perf["perf / reviewer"] bugs --> report["report / writer"] perf --> report
Writing a workflow
Section titled “Writing a workflow”Workflows live as JSON under .carina/workflows/:
- <workspace>/.carina/workflows/
- review.json
- ~/.carina/workflows/
- home overrides…
{ "name": "review", "description": "Scan changed files, review in parallel, then synthesize a report.", "steps": [ {"id": "scan", "agent": "scout", "task": "List the files changed in the working tree."}, {"id": "bugs", "agent": "reviewer", "task": "Review for bugs:\n${scan}", "needs": ["scan"]}, {"id": "perf", "agent": "reviewer", "task": "Review for perf:\n${scan}", "needs": ["scan"]}, {"id": "report", "agent": "writer", "task": "Synthesize:\n${bugs}\n${perf}", "needs": ["bugs", "perf"]} ]}${step_id}interpolates a completed dependency’s whole outputneedsis the only required ordering constraint- Steps with no shared dependency run in parallel
Example in-repo: examples/workflows/review.json.
Running
Section titled “Running”carina workflow run reviewcarina workflow run review "focus on auth"carina workflow run review --session sess_123carina workflow run review --backgroundcarina workflow listcarina workflow status RUN_IDcarina workflow pause|resume|stop|restart RUN_IDWithout --background, the CLI polls until terminal state and exits non-zero for anything other than completed.
| Command | Behavior |
|---|---|
stop | Cancel run context; durable run → stopped |
pause | Stop admitting newly-ready nodes; running work may finish |
resume | Release nodes that became ready while paused |
restart | New run ID and attempt from a terminal run |
Also available over RPC (workflow.run, workflow.list, …) and via the agent tool:
{"tool":"workflow","workflow":"review","task":"..."}Execution modes
Section titled “Execution modes”BSP (default)
Section titled “BSP (default)”Runs steps in dependency levels: collect every ready step, wait for all to finish, then next level. Simple, but one slow step stalls siblings; a single failure aborts the whole run. Step ceiling: 64.
Streaming
Section titled “Streaming”"execution_mode": "streaming"Dispatches a step the instant its own dependencies resolve. Higher step ceiling (1000). Failures isolate to dependents by default; "fail_fast": true on a step restores abort-everything. Use for uneven durations or large graphs.
Example: examples/workflows/swarm-review.json.
Conditional edges
Section titled “Conditional edges”{"id": "bugs", "agent": "reviewer", "needs": ["scan"], "when": {">": [{"var": "scan.count"}, 0]}, "input": {"files": "${scan.files}"}, "task": "Review the given files for correctness bugs."}input resolves against a dependency’s JSON-parsed output.
Source of truth
Section titled “Source of truth”- Narrative:
docs/workflows.md· examples underexamples/workflows/ - CLI:
carina workflow run|list|status|pause|resume|stop|restart - Related: Sub-agents · Policy · Workers
- Review tutorial — end-to-end pipeline
- Common workflows — day-to-day recipes
Was this page helpful?
What went wrong?
Thanks for the feedback.
One vote per page is recorded during this session.