Prompt chaining means splitting one task into a sequence of smaller prompts, where the output of each prompt becomes the input of the next. Each prompt does one narrow job, so you can check and fix the work between steps.
It fits tasks with distinct stages: extract, then calculate. Draft, then review. Outline, then write. It also fits any job where you need to see the in-between work, not just the final answer.
But a chain is not automatically better than one good prompt. When we tested 8 messy order emails through the OpenAI API on 1 December 2026, a two-step chain scored 91.7% on gpt-4.1-mini. One prompt that simply asked the model to work step by step scored 100%. The chain lost.
This lesson shows why, and covers how chains work, what our test revealed, the design rules that stop a chain breaking, copy-ready templates, and when not to chain at all.
How Prompt Chaining Works
The idea goes back to the AI Chains paper by Wu, Terry and Cai, posted to arXiv in 2021 and published at CHI 2022. In their 20-person user study, chaining LLM steps improved task outcomes and made the system feel more transparent and controllable.
The mechanics are simple. Each step is its own prompt: a fresh message in chat, or a new API call in code. You take the output of step 1 and paste it into a placeholder in step 2. That second model only sees what you hand it, nothing else.
You can run a chain by hand in ChatGPT, Claude or Gemini, with no code at all. Paste the first output into your next message, or open a fresh chat per step so earlier context cannot bleed in. In automation, a script fires each call and moves the data along for you.
Here is a two-step chain for a Diwali sale email for an Indian D2C skincare brand:
STEP 1 PROMPT
From these product notes, list the offer, the deadline, the 3 best-selling products and their prices as JSON. Do not write any copy.
OUTPUT 1
{
"offer": "20% off the festive range",
"deadline": "12 November",
"products": [
{"name": "Face Wash", "price": "Rs 349"},
{"name": "Vitamin C Serum", "price": "Rs 649"},
{"name": "Sunscreen SPF 50", "price": "Rs 499"}
]
}
STEP 2 PROMPT
Using only the facts in this JSON: {{step_1_output}}, write a 120-word sale email with one subject line.
The split buys you a checkpoint. You can read Output 1 and fix a wrong price before any copy gets written.
Same Task, Different Prompts: What We Found
A checkpoint only earns its keep when step 1 gets the facts right. We ran these tests through the OpenAI API on 1 December 2026 with gpt-4.1-mini (non-reasoning) and gpt-5.4-mini (reasoning off by default), 3 runs of each prompt on 8 messy order emails with exact totals, so 24 answers per result.
The emails were built to trip a model up: a discount on some items only, GST in rupees, bulk pricing, a late fee on hours but not expenses, a rebate that must not be deducted, half-price children inside a headcount, and tiered print pricing.
We tested three variants. One prompt asked for the number only. One prompt asked the model to work step by step. The two-step chain had step 1 pull items and rules out as JSON without calculating, then step 2 saw only that JSON and did the maths.
Variant | gpt-4.1-mini | gpt-5.4-mini |
|---|---|---|
One prompt, answer only | 0% | 12.5% |
One prompt, step by step | 100% | 100% |
Two-step chain | 91.7% | 95.8% |

Asking for the number alone almost always failed. One step-by-step prompt got every total right on both models. The chain came close, but it never did better.
Where the Chain Went Wrong
Every chain miss started in step 1 and carried forward, because step 2 never saw the email. Take the catering order. The email said 40 people at Rs 650 per head, with 6 of those 40 children at half price, a 10% service charge on food, and 5% GST on food plus the service charge.
The extract turned one headcount into two lines:
"name": "catering", "quantity": 40 "name": "child catering", "quantity": 6, "unit_price": 325
So step 2 counted 40 adults plus 6 children, 46 people in all, and priced 46 covers. The chain closed like this:
Answer: 32282.25
That is Rs 32,282.25 instead of Rs 27,777.75. The single step-by-step prompt still had the email in front of it, so it treated the children as part of the 40 and finished with:
Total = 24,050 + 2,405 + 1,322.75 = Rs 27,777.75
The maths in both runs was fine. Only the extract was wrong, and the chain had no way to notice.
Our test has clear limits: 8 emails, two small OpenAI models, one task type (arithmetic from messy text), default sampling. It shows what can happen, not a universal ranking.
How to Design a Prompt Chain That Doesn’t Break
Every chain miss in that test started the same way: step 1 handed step 2 a bad summary. Chain design is mostly about protecting that handoff. The rules below cover where to split the work, what to pass between steps, and what the extra calls cost you.
Split Where the Job Changes
Split where the kind of work changes: reading, then judging, then writing, then checking. Anthropic’s guide to building effective agents says chaining fits tasks that divide into fixed subtasks, because each call becomes an easier task. Start with two or three steps. More steps mean more handoffs, and every handoff is a place to lose facts.
Pass Structured Output Between Steps
Ask step 1 for JSON with named fields, or clearly tagged sections, so step 2 can read the handoff without guessing. Spell out what step 1 must not do either. Our extract prompt ended with “Do not calculate anything.” Feedough’s JSON prompt generator writes those format instructions for you.
Pass the Original Input Forward or Add a Check Step
Store raw facts, not worked-out values. On the consulting invoice (14.5 hours at $90, 3 travel hours at half rate, 5% late fee on hours only), step 1 kept the halved number and the halving rule side by side:
"unit_price": 45 "description": "Travel hours are billed at half the hourly rate"
Step 2 halved it again and closed at $1,551.13 instead of $1,622.00. Two fixes contain that kind of error, and we have not tested either one. Pass the original input forward next to the JSON, so a later step can re-check the source. Or add a check step that compares the extract against the original before any maths. Anthropic calls these programmatic checks, or gates.
Run Independent Steps in Parallel
When subtasks do not depend on each other, run them side by side and merge the results. Checking a draft for tone and for facts at the same time is one case. Anthropic’s workflow patterns name this parallelization, and they name routing too: classify the input first, then send it to a prompt built for that type.
Count the Cost in Tokens and Time
Extra calls cost tokens and seconds. In our test the chain used about 4x the input tokens and about 2x the time of the single step-by-step prompt.
Model | Input tokens: chain vs one prompt | Time: chain vs one prompt |
|---|---|---|
gpt-4.1-mini | 344 vs 86 | 6.3 s vs 3.0 s |
gpt-5.4-mini | 384 vs 85 | 3.9 s vs 1.7 s |
Anthropic’s own framing is that chaining trades latency for higher accuracy, so pay that price only when the checkpoint is worth it.
Copy-Ready Prompt Chaining Templates
The four chains below use the design rules from above: JSON handoffs, the original input passed forward, and a check step. Each block has its prompts ready to paste. Replace anything in [BRACKETS] with your own text, run step 1, then paste its answer where the next prompt says {{step_1_output}}.
Marketing: Brief to Checked Draft
STEP 1
From [PRODUCT BRIEF], return JSON: audience, one promise,
3 proof points, banned claims. Write no copy.
STEP 2
Write [HERO HEADLINE + SUBHEAD OR AD COPY] using only this JSON:
{{step_1_output}}
STEP 3
Compare the draft to [PRODUCT BRIEF]. List any claim not in it.
Use it for launch copy, where one wrong claim can cost you.
Support and Ops: Ticket to Reply
STEP 1
From this ticket [PASTE MESSAGE], return JSON: issue, order ID,
sentiment, requested outcome.
STEP 2
Sort it into one of [YOUR CATEGORIES] and set urgency 1 to 3.
Input: {{step_1_output}}
STEP 3
Draft a reply using the JSON and the original message [PASTE MESSAGE].
It mirrors Google Cloud’s guide to breaking down prompts, where a telecom firm extracts customer issues, categorizes them, then writes recommendations.
Analysis: Raw Numbers to a Short Memo
STEP 1
List every figure in [PASTE EXPORT OR SURVEY] with its label. No maths.
STEP 2
Calculate [METRICS YOU NEED] from that list and the original data.
Show your working.
List: {{step_1_output}}
STEP 3
Write a 5-bullet memo for a founder from that working.
Step 2 sees the raw data too, so a bad label can still be caught before the memo.
Coding: Spec to Reviewed Code
STEP 1
Turn [FEATURE REQUEST] into a spec: inputs, outputs, edge cases. No code.
STEP 2
Write [LANGUAGE] code from this spec only:
{{step_1_output}}
STEP 3
Review the code against the spec. List edge cases that fail.
This one runs in any chat window or coding assistant.
When Prompt Chaining Fails (and When You Don’t Need It)
Those templates earn their cost on hard jobs. On a simple one, a chain is just extra calls.
Reasoning Models Often Do the Steps Themselves
Anthropic’s Claude prompting docs say that with adaptive thinking and subagent orchestration, Claude handles most multistep reasoning inside a single call. Chain, that page adds, only when you want to inspect an intermediate output or enforce a fixed pipeline. It calls draft, review against criteria, refine, as three separate calls, the most common chaining pattern.
OpenAI’s prompt engineering guide has no tactic for splitting work across calls. Its agentic sample prompt tells the model to break the query into sub-requests and confirm each one is done, all inside one prompt.
Our own run points the same way. We asked gpt-5.4-mini with reasoning_effort set to medium for the number only, and it scored 100% on the same 8 emails, in about 1.2 seconds and 90 output tokens. The chain on that model with reasoning off took 3.9 seconds and scored 95.8%.
So try one step-by-step prompt first. Feedough’s chain of thought prompt generator writes one for you. Add a chain only when you need a checkpoint you can read.
Signs a Chain Is Hurting You
A few patterns say the split is costing you more than it returns:
- Step 2 needs a fact that step 1 dropped or flattened.
- An error in an early step reaches the final answer with no check in between.
- The wording or format drifts between steps.
- Each step adds tokens and wait time, and quality stays flat.
Prompt Chaining vs Chain of Thought and Meta Prompting
These names get mixed up, but they do different jobs. Chain of thought prompting asks the model to reason step by step inside one prompt. Prompt chaining splits the work across several prompts you control. Meta prompting uses a prompt to write or improve another prompt. Tree of thought prompting explores several reasoning paths and keeps the best one.
Technique | What it does | When to use it | Cost in tokens | Typical gain |
|---|---|---|---|---|
Prompt chaining | Several prompts, where each output feeds the next | Tasks with fixed stages you want to inspect | Several calls; about 4x the input tokens of one step-by-step prompt in our test | A Findings of ACL 2024 study on prompt chaining vs stepwise prompts found separate GPT-4 draft, critique and refine prompts beat a one-step draft in 77 of 100 summaries, against 53 when the three phases sat in one prompt |
Chain of thought | One prompt that asks for step by step reasoning | Maths and logic inside a single answer | One call | In our test, one step-by-step prompt matched or beat the two-step chain on maths |
Meta prompting | A prompt that writes or improves your prompt | Wording and structure of the prompt itself | One extra call | Better prompt text, not a better task split |
Tree of thought | Several reasoning paths tried, best one kept | Open problems with no clear single route | Many calls | Wider search, at the highest token cost |
That 77 of 100 result came from GPT-4 judging summaries on one dataset, so treat it as one signal rather than a ranking. The same paper’s sharper point is the difference between chaining and doing the same work in one stepwise prompt: when all three phases sit in one prompt, the model may only simulate refinement.
Try It in Feedough’s AI Prompt Generator
Build the first link of your own chain with the free AI Prompt Generator. Three steps get you there.

- Open the generator and describe step 1 of your chain only. For example: “Extract every product, price and discount from this order email as JSON, do not calculate.”
- Generate the prompt, run it in ChatGPT, Claude or Gemini, and check the output before moving on.
- Go back to the generator for step 2. Describe what it must do with that output, and add the {{step_1_output}} placeholder plus the original text.
Building each step as its own prompt keeps every link of the chain focused.
Prompt Chaining: Quick Answers
These are the questions people ask most after trying their first chain.
What is a prompt chain?
A prompt chain is the series of linked prompts itself: one task split across prompts, where each step’s output feeds the next. A common three-step chain writes an outline, checks that outline against your criteria, then writes the document from the checked outline.
What are some prompt chaining examples?
Write marketing copy, then translate it into a second language. Pull the issue out of a support ticket, sort it into a category, then draft the reply. Extract the order lines from an email as JSON, then calculate the total in a separate prompt.
What is the difference between prompt chaining and chain of thought?
Chain of thought keeps the steps inside one prompt and one answer. Prompt chaining puts the steps in separate prompts, so you can read and check the output between calls. The comparison table earlier in this lesson shows the cost and gain of each.
When should you use prompt chaining?
Use it when a task has distinct stages, when you want to check the work between them, or when a long result has to come out right on every run. In a case study on prompt chaining for report generation, a multi-stage chain finished 100% of runs versus 50% for an optimised single prompt, with a small quality edge (ROUGE-L F1 0.507 vs 0.486). It is a single-author paper on one report type, so treat it as one case, not proof.
What are the types of prompt chaining?
Four shapes cover most chains. Sequential is a straight line, where each step feeds the next. Conditional routing lets an early step decide which prompt runs. Parallel runs independent prompts at the same time, then merges the answers. A loop drafts, reviews and refines until the output passes your checks.
The Bottom Line
Start with one well-structured prompt. Ask for step by step thinking, or use a reasoning model. Add a prompt chain only when you need to see, check or reuse the work between steps.
When you do chain, hand off structured data and keep raw facts instead of worked-out values. Pass the original input forward, or add a check step between the maths and the finish. Errors from step 1 travel, and only a checkpoint catches them.