Pass Structured Handoffs Between Chain Steps
What it is
A reliability technique for prompt chains: have each step emit its result in a defined structure — a labelled list, a table, JSON — that the next step consumes, instead of piping loose prose from one prompt into the next and hoping it parses.
Why it works
When a step outputs free-form prose, the next step has to re-interpret it, and small variations in phrasing cause dropped fields and misreadings that surface as a wrong final answer with no obvious cause. A defined handoff format is a contract between steps: step B knows exactly what shape to expect, you can validate the handoff independently, and the chain behaves the same way every run instead of depending on how chatty step A felt that time.
When to use it
Any chain you'll run more than once, anything automated, and steps where completeness matters — extractions, classifications, structured analyses feeding a synthesis.
When not to use it
A quick one-off two-step chain you're driving by hand, where the overhead of defining a format outweighs the reliability you'd gain.
Prompt
Step 1: <the job>. Output the result as <defined structure: e.g. a JSON array of {claim, source, confidence}>. Only that structure, nothing else.
Step 2 (next turn): Here is the step-1 output: <paste>. Using only these fields, <the next job>. If a field is missing or malformed, say so rather than guessing.Example
A extraction step emits [{claim, source}]; the synthesis step consumes that array and can't accidentally invent a claim, because it's told to work only from the structured input — the chain gives the same result whether you run it today or next week.
Advanced version
Define the handoff schema once and reuse it across similar chains. A stable intermediate format lets you swap or improve an individual step without rewriting the ones around it, the same way a good API boundary lets you change an implementation.
Common mistakes
- Piping prose between steps and getting silent field drops.
- Letting a step add commentary around the structured output so the next step can't cleanly parse it.
- Not handling the 'malformed handoff' case, so one bad step corrupts the rest without warning.