/outputai:output-workflow-runfrom outputai
Executes an Output SDK workflow synchronously and returns the result directly in the terminal. Useful for testing workflows, debugging with different inputs, and quick one-off executions.
Ships in outputai. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill executes a workflow synchronously, meaning the command waits for the workflow to complete and returns the result directly. This is ideal for testing, quick executions, and when you need immediate feedback.
Consider using npx output workflow start (async) when:
npx output workflow run <workflowName> --input '<json-input>'
npx output workflow run <workflowName> --input <path-to-json-file>
The --input flag is required when the workflow expects input data.
Pass JSON directly on the command line:
npx output workflow run example --input '{"question": "who really is ada lovelace?"}'
Reference a JSON file containing the input:
npx output workflow run simple --input src/simple/scenarios/question_ada_lovelace.json
This is the recommended approach because:
Workflows typically have a scenarios/ folder containing test inputs:
src/
my_workflow/
workflow.ts
steps.ts
scenarios/
basic_test.json
edge_case_empty.json
large_payload.json
Best practice workflow:
Create a scenario file with your input:
# Create scenarios folder if it doesn't exist
mkdir -p src/my_workflow/scenarios
Write your input to a scenario file:
// src/my_workflow/scenarios/test_user.json
{
"userId": "123",
"options": {
"verbose": true
}
}
Run the workflow referencing the scenario:
npx output workflow run my_workflow --input src/my_workflow/scenarios/test_user.json
# Inline JSON - simple object
npx output workflow run my-workflow --input '{"userId": "123"}'
# Inline JSON - complex nested input
npx output workflow run data-pipeline --input '{"source": "api", "options": {"limit": 100}}'
# File path - reference a scenario file
npx output workflow run simple --input src/simple/scenarios/basic.json
# File path - relative to current directory
npx output workflow run batch-processor --input ./test_inputs/batch1.json
# No input (only if workflow doesn't require it)
npx output workflow run health-check
The command returns the workflow result directly to stdout.
The workflow's return value is displayed, typically as JSON.
If the workflow fails, you'll see:
npx output workflow debug for detailsScenario: Test a workflow with a scenario file
# First, look for existing scenarios
ls src/simple/scenarios/
# Run using a scenario file
npx output workflow run simple --input src/simple/scenarios/basic_sum.json
# Output:
# { "sum": 6, "count": 3 }
Scenario: Create and run a new test scenario
# Create a scenario file
cat > src/my_workflow/scenarios/test_case_1.json << 'EOF'
{
"question": "What is the capital of France?",
"context": "geography"
}
EOF
# Run the workflow
npx output workflow run my_workflow --input src/my_workflow/scenarios/test_case_1.json
Scenario: Quick inline test during development
npx output workflow run example --input '{"question": "explain quantum computing"}'
Scenario: Re-run a workflow with different input for debugging
# First attempt with scenario file
npx output workflow run process-data --input src/process_data/scenarios/user_abc.json
# Error occurs
# Create a new scenario to isolate the issue
cat > src/process_data/scenarios/debug_minimal.json << 'EOF'
{"id": "test", "debug": true}
EOF
npx output workflow run process-data --input src/process_data/scenarios/debug_minimal.json
Scenario: Capture output for further processing
# Save result to a file
npx output workflow run generate-report --input src/generate_report/scenarios/jan_2024.json > report.json
# Pipe to jq for processing
npx output workflow run get-users --input src/get_users/scenarios/active.json | jq '.users[].name'
| Error | Cause | Solution |
|---|---|---|
| "Workflow not found" | Workflow name is incorrect | Check with npx output workflow list |
| "Invalid input" | JSON doesn't match schema | Verify input matches workflow's inputSchema |
| "Parse error" | Malformed JSON or file not found | Check JSON syntax or file path |
| "Timeout" | Workflow took too long | Use async execution for long workflows |
When a workflow fails, the output includes the workflow ID. Use it to read the run's history:
npx output workflow run my-workflow --input src/my_workflow/scenarios/test.json
# Output: Workflow failed. ID: abc123xyz
npx output workflow debug abc123xyz
inputSchema in the codescenarios/ foldernpx output workflow start <name> --input - Start asynchronouslynpx output workflow list - See available workflowsnpx output workflow debug <id> - Debug a failed runWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
output-sdk, workflow-execution, cli-workflow, synchronous-run
51 skills in this plugin
/output-build-workflowImplement an Output SDK workflow from a plan document. Use when the user asks to build, implement, or code a workflow from an existing plan, or after output-plan-workflow has produced a plan and the user is ready to build./output-credentials-editView, edit, and set encrypted credentials in an Output.ai project. Use when adding secrets, updating API keys, verifying credential values, or retrieving a specific credential./output-credentials-env-varsWire encrypted credentials to environment variables using the credential: convention. Use when setting up LLM provider keys (ANTHROPIC_API_KEY, OPENAI_API_KEY) or any env var that should come from encrypted credentials.npx claudepluginhub growthxai/output --plugin outputaiOther plugins' skills for the same job