- Synchronous —
output workflow runexecutes the workflow and waits for the result. Use this during development and for short-lived workflows. - Asynchronous —
output workflow startkicks off the workflow and returns immediately. Usestatusandresultto check on it later. Use this for long-running workflows or batch jobs.
Running a Workflow
output workflow run executes a workflow and waits for the result:
--format json if you need machine-readable output, for example when piping to another command or in scripts:
Starting a Workflow Asynchronously
output workflow start fires off a workflow without waiting. It returns a workflow ID immediately:
- The workflow takes minutes or longer to complete
- You’re launching multiple workflows in a batch
- You want to check results later rather than keeping a terminal open
run, minus --format (there’s no result to format yet).
Checking Status
Poll a running workflow withoutput workflow status:
Getting Results
Once a workflow completes, retrieve its output withoutput workflow result:
--format json for the full structured response including status, output, error, and execution metadata fields. See the CLI package docs for the JSON format.
Debugging Execution
When something goes wrong — or you just want to understand what happened — useoutput workflow debug to see the execution trace:
--format json to get the full untruncated trace — this is especially useful when you need to see complete LLM inputs and outputs:
Stopping Workflows
If you need to cancel a running workflow:output workflow stop <workflowId>— Graceful cancellation. The workflow has a chance to clean up.output workflow terminate <workflowId>— Immediate kill. Use for stuck workflows or cleanup after branch switches.
Rerunning From a Step
When a workflow fails late — or you’ve edited a prompt that only affects a downstream step — you usually don’t want to re-run the whole thing. Early steps may have made expensive LLM calls, or slow API requests whose results haven’t changed.output workflow reset creates a new run that replays up to a given completed step (reusing its recorded output), then re-executes every step after it:
output workflow debug <workflowId> --format json. The step itself is not re-executed; only the steps after it.
Quick Reference
For the full CLI reference including all flags and additional commands like
workflow cost and workflow test, see the CLI package docs.
Scenario Files
A scenario file is a plain JSON file that contains the input for a workflow run. It lives in the workflow’sscenarios/ directory and matches the workflow’s inputSchema:
scenarios/acme.json
.json. To run with the acme scenario: