Pipeline Orchestration
Assembly line: each stage transforms and passes forward.
The Pattern
Section titled “The Pattern”Structure work as sequential stages, where:
- Each stage has a clear input and output contract
- Output of stage N becomes input to stage N+1
- Stages can be swapped, versioned, or optimized independently
When to Use
Section titled “When to Use”- Multi-step transformations (draft → review → polish)
- Tasks with natural phases (research → plan → execute)
- When intermediate outputs are valuable checkpoints
- Processes that benefit from separation of concerns
Implementation Notes
Section titled “Implementation Notes”- Define clear interfaces between stages
- Consider checkpointing: save intermediate state for debugging or retry
- Each stage should be independently testable
- Failures should identify which stage broke
Example Pipelines
Section titled “Example Pipelines”Research Pipeline
- Query expansion (what to search for)
- Search execution (gather sources)
- Extraction (pull relevant facts)
- Synthesis (combine into answer)
Code Review Pipeline
- Diff analysis (what changed)
- Impact assessment (what could break)
- Finding generation (specific issues)
- Priority ranking (what matters most)
Anti-patterns
Section titled “Anti-patterns”- Stages that are too coupled (can’t run one without all the others)
- No visibility into intermediate state
- Monolithic “do everything” stages that defeat the purpose
Related Patterns
Section titled “Related Patterns”- Subagent Fanout: Parallel instead of sequential
