Quick Start
Workflow Structure
A workflow is defined in YAML with metadata, agent requirements, and steps:Step Modes
Workflows support 5 step execution modes for different control flow patterns:Sequential
Linear execution — step runs once, workflow proceeds to next step.Use for: Single-execution tasks, API calls, data transforms
Fanout
Parallel execution — step runs concurrently across multiple inputs.Use for: Batch processing, parallel API calls, map operations
Collect
Aggregation — gathers results from previous fanout step.Use for: Reduce operations, result merging, consensus
Conditional
Branching — executes only if condition evaluates to true.Use for: Error handling, feature flags, A/B testing
Loop
Iterative execution — repeats until condition is met or max iterations reached.Use for: Iterative refinement, retry logic, convergence
Error Handling
Three error modes control workflow resilience:Example Workflows
AgentOS includes 3 production-ready workflow templates:Feature Build Workflow
Standard feature development with architect, coder, and iterative code review:MVP Sprint Workflow
End-to-end MVP delivery from discovery through deployment:Incident Response Workflow
Automated incident triage, investigation, and remediation:Advanced Patterns
Fanout-Collect Pattern
Process multiple items in parallel, then aggregate results:Conditional Branching
Execute different paths based on previous step results:Iterative Refinement Loop
Refine output until quality threshold is met:Variable Interpolation
Workflows use Handlebars-style templating for dynamic prompts:{{input}}- Workflow input{{<stepName>}}- Output from previous step{{iteration}}- Current loop iteration (loop mode only){{maxIterations}}- Max iterations (loop mode only)
Workflow Management
Create from file
Create from file
List workflows
List workflows
Execute workflow
Execute workflow
Monitor execution
Monitor execution
Cancel running workflow
Cancel running workflow
Programmatic API
Workflows can be created and executed programmatically:Integration with Hands
Trigger hands as workflow steps:Security & Approval
Workflows respect security boundaries:- Capability Checks: All agent functions are checked against RBAC before execution
- Approval Gates: Destructive steps can require human approval
- Audit Trail: Complete workflow execution is logged to Merkle chain
- Sandboxing: Code execution steps run in Docker/WASM sandbox
Best Practices
Idempotency
Design steps to be idempotent so workflows can be safely retried.
Timeouts
Set realistic timeouts for each step. Long-running operations should use higher timeouts.
Error Handling
Use
fail for critical steps, retry for network operations, skip for optional steps.Variable Naming
Use descriptive
outputVar names that clearly indicate the step’s output.Loop Limits
Always set
maxIterations on loop steps to prevent infinite execution.Next Steps
Agent Templates
Browse the 45 agent templates available for workflows
Hands
Use autonomous hands in workflow steps
Swarms
Coordinate multiple agents with swarm strategies
Security
Configure approval gates for sensitive workflow steps