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 run 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
Command groups
pflow (default)
Run workflows by name or file
pflow list / find / describe
Find and inspect saved workflows
pflow skill
Publish workflows as AI agent skills
pflow guide / probe
Learn the surface and test single nodes
pflow mcp
Manage MCP server connections
pflow settings
Configure API keys and node filtering
pflow ui
Interactive browser canvas for a workflow
pflow mermaid
Generate a Mermaid flowchart from a workflow
pflow guide
Get AI agent entry guidance
Main command
The defaultpflow command runs workflows. Your agent uses this to run saved workflows or workflow files it has created.
Run a saved workflow
Run from a file
No built-in natural language mode. pflow executes workflow files and saved workflows. Your AI agent builds workflows using pflow’s MCP tools or CLI primitives — pflow doesn’t have its own natural language interface.
Global options
| Option | Description |
|---|---|
--version | Show pflow version |
-v, --verbose | Show detailed execution output |
-o, --output-key KEY | Specific shared store key to output |
--output-format text|json | Output format (default: text) |
-p, --print | Minimal output: suppress header, summary, and warnings |
--no-trace | Disable workflow trace saving |
--cache/--no-cache | Enable/disable memoization cache reads (default: enabled) |
--only NODE | Re-run just this node against a snapshot of the last full run (upstream restored, not re-executed; needs a prior full run) |
--validate-only | Validate workflow without running |
--dry-run | Preview which nodes would run or serve from cache, without executing |
--help | Show help message |
Older natural-language workflow generation flags have been removed. Use the current global options shown above, or let your AI agent build
.pflow.md workflows directly.Parameter syntax
Pass parameters to workflows usingkey=value syntax:
true/false→ boolean10→ integer3.14→ float'["a","b"]'→ JSON array'{"key":"val"}'→ JSON object- Everything else → string
Stdin input
Pipe data into workflows that declare an input withstdin: true:
-p flag to output results for the next workflow:
Stdout output
Workflows that declare multiple outputs mark one withstdout: true to pick which output lands on process stdout in text mode:
stdout: true stream the first declared output and print a warning on stderr naming the other outputs and the three ways to change the routing: add the marker, pass -o, or switch to JSON mode. The validator enforces that at most one output per workflow is marked.
Output modes
Text mode (default)
Human-readable output with live progress streamed to stderr and results on stdout. Works the same way in a terminal, CI log, agent bash tool, or subprocess capture:JSON mode
Structured output on stdout for machine parsing:-p).
Print mode (-p)
Minimal stderr output when you want the cleanest possible data stream:
Exit codes
| Code | Meaning |
|---|---|
0 | Workflow completed, including runs that completed with warnings (status: "degraded") |
1 | Workflow failed |
130 | Workflow interrupted |
Validation mode
Validate a workflow without running it:Dry-run mode
Preview what a workflow would do without running it.--dry-run walks the graph using the same cache lookup the engine uses at runtime, but never invokes a node — no shell commands, LLM calls, HTTP requests, file writes, or trace files:
↻, would-execute nodes with ▸, and a divider marks the cache boundary:
nothing cached — full run.
For would-execute LLM nodes, the plan surfaces the cost from the most recent cache entry — labeled ≈ because pricing may have drifted. Per-node duration annotations appear on any would-execute node whose last run took at least 1 second; faster nodes stay bare:
JSON output
{workflow, plan, summary, diagnostics}.
Flag combinations
| Flag | With --dry-run |
|---|---|
--validate-only | Rejected with exit 1 — different audiences, different exit contracts |
--report, --report-dir | Rejected with exit 1 — no execution means no report |
--no-cache | Every node shows as would-execute |
--only NODE | Plan stops at the named node |
--no-trace, -p, -o | Accepted silently — dry-run writes no traces, and the plan itself is the result |
Iteration and caching
pflow caches node outputs automatically. When your agent re-runs a workflow file, unchanged nodes return instantly from a persistent cache — only nodes whose configuration or inputs changed will re-execute.~/.pflow/cache/cache.db.
Run a single node
The--only flag runs just the named node against a frozen snapshot of the most recent full run. Every other node’s output is restored from that run — not re-executed — so a side-effecting upstream node like shell: git push does not run again. It needs a prior full run to snapshot from (otherwise it errors). Targeting a node inside a sub-workflow is not supported.
-o, --only streams the targeted node’s result to stdout instead of the workflow’s full-run outputs. Pass -o <key> when you need a specific named output.
This is how agents iterate on a specific node without re-running the full workflow.
Bypass memo cache reads
Use--no-cache to bypass pflow memo-cache reads, so nodes execute again. Memo cache writes still happen, so the next run without --no-cache benefits from the results:
## Cache / prompt_cache:, OpenAI automatic prompt caching, or Gemini implicit caching.
Per-node caching
Onlyllm nodes cache by default — their output is purely a function of their declared inputs. Every other node type (shell, code, http, file ops, mcp, claude-code) defaults to NOT caching, because they side-effect or read external state (git branch, date, environment variables, files, network). So a node like git branch --show-current re-runs every time with no annotation needed:
.pflow-report.json
marker.
Disable traces with --no-trace for faster execution (the --report flag overrides --no-trace).
UI command
Serve an interactive browser canvas for a workflow — the visual counterpart topflow mermaid. Where mermaid emits static text, pflow ui opens a local browser canvas: collapsible sub-workflow, batch, and loop containers, click-to-read prompts and params, ${ref} data-flow lines, and a source pane.
.pflow.md is edited on disk, so you can watch it take shape (while keeping the current zoom and selection) as you, or an AI agent, build it. An edit that doesn’t validate is held: the last valid version stays on screen with an error banner until the source parses again. The server blocks until Ctrl+C, so run it in the background while you edit.
Runs on a standard install. If pflow ui reports a missing dependency, add the server extra: uv tool install 'pflow-cli[ui]'.
| Option | Description |
|---|---|
--port N | Port to serve on (default: 8765) |
--no-open | Don’t open a browser window |
--no-auto-update | Freeze the view — don’t live-update when the source changes |
?workflow=<name-or-path>&focus=<node-id>&direction=TD. focus= highlights a node and reveals its connections; node= centers the camera on it.
An agent can interact with every open Viewer showing a workflow:
.pflow.md: a step, input, or output by its name (process_content, source_file), or a connection as source -> target (gen.response -> summarize.prompt) — there’s no separate notation to learn. If a name matches more than one thing — the same step inside two sub-workflows, or an input and output that share a name — the command lists qualified addresses to pick from instead of guessing, and an unknown name returns the closest real matches. So you point, read the reply, and re-point.
These commands target port 8765 by default (pass --port N for another instance). Point commands exit nonzero when the target is unresolved/ambiguous or no Viewer received the command. focus --open opens a Viewer only when no window for that workflow is connected.
Mermaid command
Generate a Mermaid flowchart from a workflow. Shows the graph topology — nodes, edges, conditional branches, error routes, inputs, outputs — that’s otherwise scattered across individual node directives in the.pflow.md file. For an interactive, collapsible canvas instead of static text, see the UI command.
--validate-only). On validation failure, it shows diagnostics and exits with code 1. On success, it outputs Mermaid syntax to stdout.
.md output wraps the diagram in a markdown document with the workflow’s title and description, ready to commit or share.
| Option | Description |
|---|---|
-o, --output FILE | Write to file. .md extension wraps in markdown with title and fenced code block. Any other extension writes raw Mermaid syntax. |
--depth N | Sub-workflow expansion depth (default: 5, 0 = no expansion) |
--direction LR|TD | Graph direction: left-to-right or top-down (default: LR) |
--descriptions | Add first sentence of each node’s purpose to its label |
type: workflow) expand into subgraph blocks showing their internal structure. Use --depth 0 to render them as opaque nodes, or --depth 2 to expand nested sub-workflows:
Guide command
Thepflow guide command provides the entry guidance for AI agents using pflow.
pflow --help. Topic composition is introduced in Task 77.
Related
- Workflow commands - Find and manage saved workflows
- Skill commands - Publish workflows as AI agent skills
- Guide and probe - Learn the surface and test single nodes
- MCP commands - Manage MCP servers
- Settings commands - Configure pflow

