Appearance
How It Works
workflow-manager turns a Markdown workflow definition into a deterministic run.
Execution flow
- Parse Markdown frontmatter into a
WorkflowDefinition. - Validate schema-level constraints (keys, dependencies, adapters, validation modes).
- Initialize queued run state and create a
StepRunfor each step. - Validate host runtime access for real adapters before execution starts.
- Execute steps in dependency order, enforcing
dependsOnbefore each step starts. - Build an input envelope with global state, step context, and adapter init data.
- Execute the step with the
picoding agent by default, or with an explicit adapter such asmock,opencode,codex, orclaude-code. - Apply validation and confirmation policy.
- Resolve routing actions (
RETRY_CURRENT,ROLLBACK_PREVIOUS,RESTART_ALL, or proceed). - Record run and step events in sequence.
- Return a full run result as JSON.
Runtime preflight fails the run before run.started when a required host command or LLM access key is missing. The default pi-agent adapter checks the configured pi command; provider keys are not inferred for pi steps because pi manages its own auth. opencode steps check the opencode CLI by default (it runs real unless taskSpec.payload.useRealAdapter: false opts out to a mock); claude-code steps check their CLI command only when opted into a real run. Known provider models require the matching OPENROUTER_API_KEY, OPENAI_API_KEY, or ANTHROPIC_API_KEY. Custom requirements can be declared with taskSpec.payload.requiredEnv.
Run wfm doctor to inspect host setup and adapter implementation status. Run wfm doctor <workflow.md|workflow.json> to validate a specific workflow's schema and runtime requirements without starting execution.
State model
- Run statuses:
queued,running,waiting_for_approval,paused,succeeded,failed,cancelled - Step statuses:
pending,runnable,running,waiting_for_approval,succeeded,failed,cancelled
Confirmation model
- A step can require no validation, human validation, or external validation.
- Confirmation can come from:
--auto-confirm-all--confirm stepKey--confirm stepKey:mode- step-level
autoConfirm
- Missing required confirmation transitions the run to
waiting_for_approval.
Retry and control routing
RETRY_CURRENT: reruns the same step untilmaxAttemptsis exceeded.ROLLBACK_PREVIOUS: resets current and previous step topendingand moves execution backward.RESTART_ALL: resets all steps and restarts from the first step.