Skip to main content
You’ve defined a workflow. Now you need to run it. Output gives you two execution modes:
  • Synchronousoutput workflow run executes the workflow and waits for the result. Use this during development and for short-lived workflows.
  • Asynchronousoutput workflow start kicks off the workflow and returns immediately. Use status and result to check on it later. Use this for long-running workflows or batch jobs.
Both modes accept input the same way: either a scenario file or inline JSON. Scenario files are covered at the end of this page.

Running a Workflow

output workflow run executes a workflow and waits for the result:
The command blocks until the workflow completes, then prints the output:
Use --format json if you need machine-readable output, for example when piping to another command or in scripts:
If the workflow fails, the command prints the error and exits with code 1.

Starting a Workflow Asynchronously

output workflow start fires off a workflow without waiting. It returns a workflow ID immediately:
This is the right choice when:
  • 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
The flags are the same as run, minus --format (there’s no result to format yet).

Checking Status

Poll a running workflow with output workflow status:
The status will be one of:

Getting Results

Once a workflow completes, retrieve its output with output workflow result:
If the workflow failed, you’ll see the error instead:
Use --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 — use output workflow debug to see the execution trace:
This prints a tree showing every step that ran, what it received, what it returned, and how long it took:
The text format truncates long values for readability. Use --format json to get the full untruncated trace — this is especially useful when you need to see complete LLM inputs and outputs:
Traces are also saved as JSON files in your project’s logs/runs/ directory. You can open these directly, share them with teammates, or feed them to Claude Code for analysis.

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:
Find valid step names with 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’s scenarios/ directory and matches the workflow’s inputSchema:
scenarios/acme.json
Scenarios are useful because they’re repeatable — you can re-run the same input without retyping it, share them with teammates, and check them into version control. Think of them as saved test inputs for your workflow. The scenario name is the filename without .json. To run with the acme scenario: