Quick Comparison
Import
AgentFlow is the primary class for deterministic pipelines (v1.0+). Workflow and Pipeline are silent aliases kept for backward compatibility — new code should use AgentFlow.Quick Start
1
Import workflow helpers
2
Combine patterns in one workflow
How It Works
Pattern Overview
1. Routing (Decision Branching)
Route to different steps based on previous output:2. Parallel (Concurrent Execution)
Execute multiple steps at the same time:3. Loop (Iterate Over Data)
Process each item in a list or file:4. Repeat (Evaluator-Optimizer)
Repeat until a condition is met:Combining Patterns
Patterns can be combined for complex workflows:Common Workflow Architectures
Orchestrator-Worker
Fan-Out/Fan-In
Batch Processing Pipeline
Self-Improving Agent
Pattern Selection Guide
Pattern Tips
1. Start Simple
2. Handle Errors
3. Use Verbose Mode
4. Track State with Variables
API Reference
Best Practices
Compose patterns instead of nesting deeply
Compose patterns instead of nesting deeply
Combine route, parallel, loop, and repeat in readable sequences — avoid deeply nested workflow trees.
Track state with workflow variables
Track state with workflow variables
Use
ctx.variables for counts and flags instead of global Python state.Enable verbose mode while designing
Enable verbose mode while designing
Step-by-step progress output helps validate routing and loop behaviour before production.
Always define a default route
Always define a default route
Unexpected classifier output should fall back to a safe path, not fail silently.
See Also
Workflow Routing
Decision-based branching
Parallel Execution
Concurrent step execution
Loop Processing
Iterate over data
Repeat Pattern
Evaluator-optimizer pattern
Workflow Input Resolution
How the value passed to
start(...) and {{input}} is resolved
