// Orchestration · ~11 min
Sequential Pipeline
Reach for it when: When stages are fixed and each step’s output is the next step’s only input.
// 60-second mental model
How to hold it in your head
Stage A finishes. Stage B gets only A’s output. Stage C gets only B’s. No sideways chat, no shared scratchpad across stages.
A sequential pipeline is a fixed DAG of stages with typed handoffs; each stage is an agent (or prompt) whose sole input is the previous stage’s structured output.
// Mini architecture
Fixed stages · typed handoffs only
┌─────────┐ out_A ┌─────────┐ out_B ┌─────────┐
│ Stage A │ ────────► │ Stage B │ ────────► │ Stage C │
│ extract │ │ enrich │ │ format │
└─────────┘ └─────────┘ └─────────┘
▲ ▲ ▲
schema_A schema_B schema_CIf B needs something A did not emit, fix the contract — do not let B peek at the original user message unless that is explicit.
// Mini-project
Invoice → JSON → summary pipeline (stub)
Three staged stubs with schemas
Goal: Extract fields from a canned invoice, enrich with a stub rate card, format a one-paragraph summary — each stage sees only the prior JSON.
- Stage A: stub OCR text → `{ vendor, amount, date }` JSON.
- Stage B: enrich with stub `rate_card` → add `{ category }`.
- Stage C: format a summary string from Stage B JSON only.
- Validate each handoff against a tiny schema; fail closed.
- Prove Stage C never receives the raw OCR text.
- Log each stage’s input hash for the demo.
Stubs keep the focus on contracts. Real OCR is optional later.
// Common failure
What goes wrong
Symptom
Hidden shared context — later stages quietly read earlier prompts and drift.
Fix
Pass only the typed handoff. If a field is missing, widen the schema upstream — do not reopen the full transcript.
// Self-reflection
Sit with this
Where are you faking a pipeline with one megaprompt that still sees everything?
Session only. Nothing is saved.