// 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_C

If 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.

  1. Stage A: stub OCR text → `{ vendor, amount, date }` JSON.
  2. Stage B: enrich with stub `rate_card` → add `{ category }`.
  3. Stage C: format a summary string from Stage B JSON only.
  4. Validate each handoff against a tiny schema; fail closed.
  5. Prove Stage C never receives the raw OCR text.
  6. 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.