Skip to main content
pflow provides a CLI for running workflows, managing MCP servers, and configuring settings.
Who runs these commands? Most pflow commands are run by your AI agent, not by you directly. You handle setup (installation, API keys, MCP servers), then your agent uses pflow to build and execute workflows. This reference documents all commands so you understand what your agent is doing. See Using pflow for what to expect day-to-day.

Command structure

pflow [command] [options] [arguments]

Command groups

Main command

The default pflow command runs workflows. Your agent runs this to execute saved workflows or workflow files it has created.

Run a saved workflow

pflow my-workflow input=data.txt threshold=0.5

Run from a file

pflow ./workflow.json
pflow ~/workflows/analysis.json param=value
pflow can generate workflows from natural language, but this feature is experimental. For production use, we recommend letting your AI agent build workflows directly.
pflow "read data.txt and summarize the content"
Natural language requests must be quoted. The planner generates a workflow, which you can save for reuse. Requires an Anthropic API key.

Global options

OptionDescription
--versionShow pflow version
-v, --verboseShow detailed execution output
-o, --output-key KEYSpecific shared store key to output
--output-format text|jsonOutput format (default: text)
-p, --printForce non-interactive output
--no-traceDisable workflow trace saving
--trace-plannerSave planner execution trace
--validate-onlyValidate workflow without executing
--auto-repairEnable automatic workflow repair on failure
--helpShow help message
These options apply when using natural language mode to generate workflows:
OptionDescription
--planner-timeout INTTimeout for planner in seconds (default: 60)
--save / --no-saveSave generated workflow (default: save)
--cache-plannerEnable cross-session LLM caching to reduce costs
--planner-model TEXTLLM model for planning (default: auto-detect)
--no-updateSave repairs to separate file instead of updating original

Parameter syntax

Pass parameters to workflows using key=value syntax:
pflow my-workflow input=data.txt count=10 enabled=true
Type inference:
  • true / false → boolean
  • 10 → integer
  • 3.14 → float
  • '["a","b"]' → JSON array
  • '{"key":"val"}' → JSON object
  • Everything else → string

Stdin input

Pipe data into workflows:
echo "test content" | pflow my-workflow
cat data.csv | pflow csv-analyzer
Stdin data is available in the workflow as ${stdin}.

Output modes

Text mode (default)

Human-readable output with progress indicators in interactive terminals:
pflow my-workflow

JSON mode

Structured output for parsing:
pflow --output-format json my-workflow | jq '.result'
Clean output for piping (no progress indicators):
pflow -p my-workflow > output.txt

Validation mode

Validate a workflow without executing it:
pflow --validate-only workflow.json
pflow --validate-only my-saved-workflow
Agents use this to check workflows before running them. Exit code 0 means valid.

Traces

By default, pflow saves execution traces to ~/.pflow/debug/:
  • Workflow traces: workflow-trace-{name}-{timestamp}.json
  • Planner traces: planner-trace-{timestamp}.json (with --trace-planner)
Disable traces with --no-trace for faster execution.

Instructions command

The pflow instructions command provides guidance for AI agents using pflow.
pflow instructions <SUBCOMMAND>
SubcommandDescription
usageBasic usage guide for AI agents (~100 lines)
createComprehensive workflow creation guide (~1600 lines)
Example:
# Get usage instructions (AI agents should run this first)
pflow instructions usage

# Get detailed workflow creation guide
pflow instructions create
AI agents should run pflow instructions usage when first connecting to pflow. This provides optimized guidance for agent-driven workflow building.