Overview
Fast Agent provides powerful workflow capabilities for orchestrating multiple agents. Workflows enable complex task decomposition, parallel processing, sequential pipelines, and iterative refinement.Workflow Types
Orchestrator Workflows
Orchestrators dynamically plan and execute tasks using available child agents.Full Planning
Creates a complete execution plan upfront before executing:- Well-defined tasks
- Fixed workflows
- Predictable requirements
Iterative Planning
Plans and executes step-by-step, adapting based on intermediate results:- Complex, open-ended tasks
- Exploratory workflows
- Adaptive problem solving
Iterative Planner
A specialized planner that continuously refines its approach:plan_iterations=-1: Unlimited iterationsplan_iterations=N: Maximum N iterations
- Research tasks
- Investigation workflows
- Long-running explorations
Router Workflows
Routers analyze requests and delegate to the most appropriate agent:- Request triage
- Department routing
- Skill-based delegation
- Topic classification
Chain Workflows
Chains execute agents in a fixed sequence:Incremental Mode (default)
Each agent receives only the previous agent’s output:- User input → Researcher
- Researcher output → Writer
- Writer output → Editor
- Editor output → User
Cumulative Mode
Each agent sees all previous outputs:- User input → Researcher
- User input + Researcher output → Writer
- User input + Researcher output + Writer output → Editor
- All previous outputs → Publisher
- Sequential processing pipelines
- Multi-stage refinement
- Assembly line patterns
- Content production workflows
Parallel Workflows
Parallel agents execute multiple agents simultaneously:Fan-out Only
Execute agents in parallel without aggregation:Fan-out with Fan-in
Execute in parallel and aggregate results:include_request=True: Fan-in agent receives original request plus all parallel resultsinclude_request=False: Fan-in agent receives only parallel results
- Multi-perspective analysis
- Parallel data processing
- Consensus building
- Simultaneous evaluations
Evaluator-Optimizer Workflows
Iteratively generate and refine outputs based on quality evaluation:- Generator creates initial output
- Evaluator rates and provides feedback
- If rating < min_rating and refinements < max_refinements:
- Generator refines based on feedback
- Return to step 2
- Return final output
- Quality-critical outputs
- Code generation and refinement
- Professional writing
- Iterative improvement
MAKER Workflows
Statistical error correction through voting consensus:"exact": Character-for-character match"normalized": Ignore whitespace and case differences"structured": Parse as JSON and compare structurally
red_flag_max_length filters out verbose responses.
Best for:
- High-stakes decisions
- Error-critical outputs
- Verification tasks
- Calculations and factual queries
Workflow Composition
Nested Workflows
Workflows can use other workflows as child agents:Parallel + Chain Pattern
Router + Workflow Pattern
Best Practices
Choose the Right Workflow
Use Orchestrator when...
Use Orchestrator when...
- Tasks require dynamic planning
- Requirements are complex or open-ended
- You need adaptive task decomposition
Use Router when...
Use Router when...
- Clear categories or departments exist
- Requests need classification
- Only one agent should handle each request
Use Chain when...
Use Chain when...
- Workflow is sequential and predictable
- Each step depends on the previous
- You have a fixed pipeline
Use Parallel when...
Use Parallel when...
- Tasks can run independently
- You need multiple perspectives
- Speed is important
- Results need aggregation
Use Evaluator-Optimizer when...
Use Evaluator-Optimizer when...
- Output quality is critical
- You can define quality criteria
- Iterative refinement makes sense
Use MAKER when...
Use MAKER when...
- Reliability is paramount
- Cost-effective models are preferred
- Statistical consensus is valuable
- Errors are unacceptable
Workflow Configuration
Model Selection:Error Handling
Performance Optimization
Parallel Execution:See Also
- Decorators - Workflow decorator reference
- Agents - Agent types and capabilities
- FastAgent - Main FastAgent class
