Basic Workflow Patterns
Sequential Workflow
Research → Analysis → Writing pipeline
The researcher's output becomes the writer's input, creating a clear data flow.
Parallel Task Assignment
Multiple agents working on the same task
Both agents receive the same task and work independently with different perspectives.
Advanced Coordination Patterns
Merge Pattern: AI Competition
Multiple models solve the same problem, then a critic evaluates
Two AI models compete to solve the same problem, then a critic agent evaluates and compares their approaches.
Fan-out Pattern: Distributed Processing
One coordinator distributes work to multiple specialists
The coordinator's output is distributed to three specialists, each performing different analysis tasks.
Complex Pipeline: Multi-stage Review
Development → Multiple reviews → Error fixing
Complex workflow: development, fan-out to multiple reviewers, merge reviews, then fix issues.
Real-world Use Cases
Content Creation Pipeline
End-to-end content production workflow
Code Review Workflow
Multi-perspective code analysis and improvement
Best Practices
Recommended Patterns
- ✓Use descriptive agent names that reflect their role
- ✓Define personas in AGENTS section for consistent behavior
- ✓Use variables for reusable workflow templates
- ✓Group complex expressions with parentheses for clarity
- ✓Keep workflows under 10 agents for performance
Common Pitfalls
- ✗Don't reuse agent handles within the same script
- ✗Avoid deeply nested parentheses - breaks readability
- ✗Don't create circular variable references
- ✗Avoid fan-out with only one target (use chain instead)
- ✗Don't leave agents without tasks
