Prompt chaining is the simplest workflow pattern. You run a fixed sequence of prompts, and the output of one becomes the input of the next. The Prompting note on chaining covers the technique in detail. This note looks at it as a workflow.
An example chain#
Turn a raw customer complaint into a polished support ticket.
| Step | Input | Job | Output |
|---|---|---|---|
| 1 | Raw complaint | Extract the core issue | "Charged twice for one order" |
| 2 | The issue | Classify it | billing |
| 3 | Issue and category | Write a formal ticket | The finished ticket |
Each step does one thing. The model does that one thing well, instead of extracting, classifying and writing all in one shot.
When it is worth it#
- One prompt does too much. A single prompt is trying to do several distinct jobs, and quality suffers.
- You need to see the middle. Each step produces output you can log, validate and inspect. If step 2 fails, you know exactly where.
Where it breaks#
| Problem | Why |
|---|---|
| Errors compound | If step 1 extracts the wrong issue, step 2 classifies the wrong thing and step 3 writes a ticket about the wrong problem. |
| Latency adds up | Three steps means three waits, one after another. |
| Cost adds up | Three steps means three API calls and three sets of input tokens. |
A check between steps stops a bad output before it travels down the chain.
Don't chain by default. The signal to chain is a single prompt that keeps producing messy output despite good instructions.
Short line#
Prompt chaining runs fixed prompts in order, each output feeding the next. Each step is focused and can be inspected. Errors compound and every step adds a call, so chain only when one good prompt keeps failing.
Key takeaways#
- A chain is a fixed sequence of prompts where each output is the next input.
- Each step does one job, so it does it better.
- Every step's output can be logged, validated and inspected.
- An early mistake carries through every later step.
- Each step adds latency and cost. Chain only when one well-written prompt keeps failing.