Prompting

How to Chain Prompts to Solve a Big Task

3 min read

Prompt chaining means running a task as several separate calls, each taking the previous output as input. The reason to do it has changed. Current models do a lot of multi-step reasoning internally, so chaining is no longer about making the model capable — it is about making the middle of the task inspectable, and about enforcing a pipeline you can log, evaluate and branch on.

The pattern

Step 1: Extract the ten key facts from this report as a bullet list.
Step 2: <paste the bullets> Turn these into a three-paragraph summary.
Step 3: <paste the summary> Rewrite for a non-technical reader, under 150 words.

Three prompts, three checkpoints. A wrong fact surfaces at step 1 instead of hiding inside a finished document.

Hand off with tags, not prose

<facts>
…step 1 output, pasted verbatim…
</facts>

Using only the facts above, write a three-paragraph executive summary.

Tagging the handoff keeps the previous output from being read as fresh instructions — the same reason tagged examples work, and a small hedge against injected text riding along in a retrieved document.

The chain worth having: self-correction

The most common useful chain is three steps — generate a draft, review it against explicit criteria, then refine using the review:

Here is a draft and the criteria it must meet.
<draft>…</draft>
<criteria>factual accuracy, no jargon, under 150 words</criteria>
List every place the draft fails a criterion. Do not rewrite it yet.

The review step, run as its own call so you can read the critique before the rewrite lands. Separating criticism from rewriting is what makes the third step useful instead of cosmetic.

When to skip it

Each link costs a round trip, tokens and latency, and each handoff loses context the earlier step had. If one well-written prompt already passes your checks, chaining is pure overhead. Reach for it when the task has genuinely distinct phases, when you need the intermediate output for something else, or when a specific step needs different settings — a low temperature for extraction, a higher one for drafting.

Measure the difference rather than guessing: evals with promptfoo will tell you whether the chain beats the single call. Source: prompting best practices.

Open the full interactive version (with copy buttons) ↗

← All guides