Deep dive
Prompt chaining: split complex work into stages
A prompt chain gives each stage one job. Between stages you can inspect, correct or stop before an error compounds.
When is a chain better than one prompt?
Use a fixed chain when the task has known stages and the intermediate result is worth inspecting. Examples include retrieve sources → extract facts → draft → verify claims, or outline → approve → write → edit.
Do not add a chain merely because a task sounds advanced. Every model call adds latency, cost and a new failure point. Start with one call and split when a measured failure can be isolated.
Four rules for a robust chain
- One visible goal per stage. The intermediate output must be reviewable.
- A narrow handoff format. Pass findings, sources, decisions and open questions, not the entire conversation.
- A gate before risky stages. Check format, evidence or approval before continuing.
- A clear stop rule. Define when the chain ends or asks a human for help.
Stage 1 — Extract
Find only claims directly supported by the sources.
Deliver: claim | source | source location | uncertainty.
Gate
Stop if an important claim has no source.
Stage 2 — Synthesize
Use only approved rows from stage 1.
Deliver a short decision memo with findings, consequences and open questions.Chain, workflow or agent?
A chain follows a fixed route. A workflow may contain rules and branches. An agent chooses its next step dynamically. Choose the simplest design that passes the test; see workflows and agents.
Sources
- AWS: Workflow for prompt chaining — sequential stages and gates
- Anthropic: Building effective agents — prompt chaining and choosing the simplest architecture