/output-workflow-run
Execute an Output SDK workflow synchronously and wait for the result. Use when running a workflow and needing immediate results, testing workflow execution, or getting the output directly in the terminal.
$ npx -y skills add growthxai/output --skill output-workflow-run --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/output-workflow-run
Context preview
The summary Claude sees to decide when to auto-load this skill.
Execute an Output SDK workflow synchronously and wait for the result. Use when running a workflow and needing immediate results, testing workflow execution, or getting the output directly in the terminal.
SKILL.md
output-workflow-run.SKILL.mdname: output-workflow-run
description: Execute an Output SDK workflow synchronously and wait for the result. Use when running a workflow and needing immediate results, testing workflow execution, or getting the output directly in the terminal.
allowed-tools: [Bash, Read, Write]
Run Workflow Synchronously
Overview
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.
When to Use This Skill
- Testing a workflow during development
- Running a workflow and needing the result immediately
- Quick one-off workflow executions
- Debugging by re-running a workflow with different inputs
- When you don't need to monitor the workflow separately
When to Use Async Instead
Consider using `npx output workflow start` (async) when:
- The workflow takes a long time (minutes to hours)
- You need to run multiple workflows in parallel
- You want to disconnect and check results later
- You need to monitor progress separately
Instructions
Basic Syntax
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.
Input Methods
1. Inline JSON
Pass JSON directly on the command line:
npx output workflow run example --input '{"question": "who really is ada lovelace?"}'2. File Path (Recommended)
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:
- Input is version controlled and reproducible
- Complex inputs are easier to read and edit
- Scenarios can be shared and reused
Scenario Folder Pattern (Best Practice)
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:**
1. Create a scenario file with your input:
# Create scenarios folder if it doesn't exist
mkdir -p src/my_workflow/scenarios
2. Write your input to a scenario file:
// src/my_workflow/scenarios/test_user.json
{
"userId": "123",
"options": {
"verbose": true
}
}3. Run the workflow referencing the scenario:
npx output workflow run my_workflow --input src/my_workflow/scenarios/test_user.json
Input Examples
# 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-checkUnderstanding the Output
The command returns the workflow result directly to stdout.
Success Output
The workflow's return value is displayed, typically as JSON.
Error Output
If the workflow fails, you'll see:
- Error message
- The workflow ID (for further debugging)
- Suggestion to use `npx output workflow debug` for details
Examples
**Scenario**: 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 Handling
Common Errors
| 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 |
Getting More Details on Failures
When a workflow fails, the output includes the workflow ID. Use it to get the full trace:
npx output workflow run my-workflow --input src/my_workflow/scenarios/test.json
# Output: Workflow failed. ID: abc123xyz
npx output workflow debug abc123xyz --json
Input Schema Tips
1. **Check the schema first**: Look at the workflow's `inputSchema` in the code 2. **Use scenario fi
Read more
name: output-workflow-run description: Execute an Output SDK workflow synchronously and wait for the result. Use when running a workflow and needing immediate results, testing workflow execution, or getting the output directly in the terminal. allowed-tools: [Bash, Read, Write]
Run Workflow Synchronously
Overview
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.
When to Use This Skill
- Testing a workflow during development
- Running a workflow and needing the result immediately
- Quick one-off workflow executions
- Debugging by re-running a workflow with different inputs
- When you don't need to monitor the workflow separately
When to Use Async Instead
Consider using `npx output workflow start` (async) when:
- The workflow takes a long time (minutes to hours)
- You need to run multiple workflows in parallel
- You want to disconnect and check results later
- You need to monitor progress separately
Instructions
Basic Syntax
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.
Input Methods
1. Inline JSON
Pass JSON directly on the command line:
npx output workflow run example --input '{"question": "who really is ada lovelace?"}'2. File Path (Recommended)
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:
- Input is version controlled and reproducible
- Complex inputs are easier to read and edit
- Scenarios can be shared and reused
Scenario Folder Pattern (Best Practice)
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:**
1. Create a scenario file with your input:
# Create scenarios folder if it doesn't exist mkdir -p src/my_workflow/scenarios
2. Write your input to a scenario file:
// src/my_workflow/scenarios/test_user.json
{
"userId": "123",
"options": {
"verbose": true
}
}3. Run the workflow referencing the scenario:
npx output workflow run my_workflow --input src/my_workflow/scenarios/test_user.json
Input Examples
# 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-checkUnderstanding the Output
The command returns the workflow result directly to stdout.
Success Output
The workflow's return value is displayed, typically as JSON.
Error Output
If the workflow fails, you'll see:
- Error message
- The workflow ID (for further debugging)
- Suggestion to use `npx output workflow debug` for details
Examples
**Scenario**: 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 Handling
Common Errors
| 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 |
Getting More Details on Failures
When a workflow fails, the output includes the workflow ID. Use it to get the full trace:
npx output workflow run my-workflow --input src/my_workflow/scenarios/test.json # Output: Workflow failed. ID: abc123xyz npx output workflow debug abc123xyz --json
Input Schema Tips
1. **Check the schema first**: Look at the workflow's `inputSchema` in the code 2. **Use scenario fi
The open-source TypeScript framework for building AI workflows and agents. Designed for Claude Code — describe what you want, Claude builds it, with all the best practices already in place. One framework.
Repo: growthxai/output
Other skills on output.
- /llm-output-schema-constraints
Zod schema constraints that Anthropic rejects or silently ignores when sent as structured-output tool definitions via Output.object(). Use when writing or reviewing Zod schemas passed to Output.object(), or debugging structured-output validation errors.
Open skill - /prompt-file-provider-options
Guide to the providerOptions structure in .prompt files — decision tree for where an option goes, common mistakes, per-provider quick reference, and Anthropic prompt caching. Use when writing or reviewing .prompt file frontmatter (provider, model, providerOptions,
Open skill - /validate
Run lint, build, and tests to validate changes are correct
Open skill - /output-build-workflow
Implement 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.
Open skill - /output-credentials-edit
View and edit encrypted credentials in an Output.ai project. Use when adding secrets, updating API keys, verifying credential values, or retrieving a specific credential.
Open skill - /output-credentials-env-vars
Wire 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.
Open skill

