TL;DR: Prompt chaining means splitting a big AI task into a sequence of smaller prompts, where the output of one step becomes the input of the next. Instead of asking a model to research, outline, write and edit in one giant prompt, you run each step separately. It is slower and uses more calls, but each step is easier for the model to get right and easier for you to check. Use it for multi-stage work like summarize, critique, rewrite; skip it for simple one-shot questions.
What is prompt chaining? It is one of the most practical techniques in prompt engineering, and it works with ChatGPT, Claude, Gemini or any large language model. Developers use it to build reliable AI pipelines, and everyday users already do a manual version of it every time they say “great, now turn that into a table.” This guide explains how prompt chaining works, how it compares with other techniques, and gives you a copy-ready template.

What is prompt chaining?
AWS Prescriptive Guidance defines prompt chaining as decomposing complex tasks into a sequence of steps, “where each step is a discrete LLM invocation that processes or builds upon the output of the previous one.” Anthropic describes the same pattern in its engineering post Building effective agents, where prompt chaining is the first and simplest of several workflow patterns, and notes that you can add programmatic checks (it calls them “gates”) between steps to make sure the process stays on track.
Think of it like an assembly line. Each station does one job well, and a supervisor can inspect the part before it moves on. A single mega-prompt is more like asking one worker to build the whole car at once.
How prompt chaining works: a simple example
Say you want a blog post from a long product report. A three-step chain might look like this:
- Extract: “Read the report below and list the 8 most important facts as bullet points, with a page reference for each.”
- Outline: “Using only these facts, write an H2/H3 outline for a 1,000-word article aimed at small-business owners.”
- Draft: “Write the article from this outline. Use only the facts provided. Mark anything uncertain with [CHECK].”
Optionally, add a fourth step: Review, “Compare the draft with the fact list and flag any claim that isn’t supported.” Anthropic’s prompting best practices highlight exactly this kind of self-correction chain: generate a draft, review it against criteria, then refine it.
Why splitting the task helps
- Focus: each prompt has one clear goal, so instructions don’t compete for the model’s attention.
- Inspectable steps: you can read the fact list before any writing happens and catch errors early.
- Easier debugging: if the final output is wrong, you can see which step went off the rails.
- Swappable parts: you can use a cheaper, faster model for extraction and a stronger one for writing.
- Room for code in between: a script can validate JSON, look up data or filter results before the next call.
Prompt chaining vs other prompting techniques
Prompt chaining is often confused with similar-sounding ideas. Here is how they differ:
| Technique | What it does | Number of model calls | Best for |
|---|---|---|---|
| Prompt chaining | Splits a task into sequential prompts; each output feeds the next | Several | Multi-stage tasks you want to check step by step |
| Chain-of-thought prompting | Asks the model to reason step by step inside one answer | One | Math, logic and reasoning questions |
| Few-shot prompting | Shows the model a few examples of the desired output | One | Matching a format, tone or label scheme |
| Zero-shot prompting | Gives instructions with no examples | One | Simple, common tasks |
| AI agents | Let the model decide its own next steps and tools in a loop | Variable | Open-ended tasks where the path isn’t known in advance |
The key distinction with agents: in a prompt chain, you decide the steps in advance. In an agent, the model decides. Anthropic’s post recommends starting with the simplest approach that works and only adding agent-style autonomy when a fixed sequence isn’t enough. If you are new to the agent side, read our explainer on what agentic AI is.
Common prompt chaining patterns
- Summarize, critique, rewrite: condense a document, list its weaknesses, then produce an improved version. AWS lists this among common use cases.
- Search, extract, answer: gather sources, pull out facts, then answer a question from those facts only.
- Plan, code, test, explain: outline the approach, write code, generate tests, then document what the code does.
- Classify, then route: first decide what kind of request it is, then send it to a prompt specialized for that type.
- Translate, then localize: translate literally, then adapt idioms and units for the target market.
A copy-ready prompt chaining template
You can run this manually in any chat app by pasting each step in turn, or wire it up in code.
STEP 1 - GATHER
Task: Read the material below and list the key facts, numbers and quotes.
Output: a numbered list only. No commentary.
Material: [paste text]
STEP 2 - STRUCTURE
Input: the list from Step 1.
Task: Turn these facts into an outline for [format] aimed at [audience].
Rules: Use only the facts in the list.
STEP 3 - PRODUCE
Input: the outline from Step 2.
Task: Write the [format] in a [tone] tone, about [length].
Rules: Mark anything uncertain with [CHECK].
STEP 4 - REVIEW
Input: the Step 1 list and the Step 3 draft.
Task: List any claim in the draft that the facts don't support,
then return a corrected version.Tips for better prompt chains
- Keep each step to one job. If a step’s instructions need “and then,” it may be two steps.
- Define the hand-off format. Ask for bullet lists, JSON or tagged sections so the next step gets clean input.
- Pass only what’s needed. Sending the whole history into every step wastes tokens and can distract the model. See our guide to tokens in AI.
- Add gates. Check outputs between steps, by eye or with code, before continuing.
- Use a system prompt for shared rules. Style or safety rules that apply to every step belong in a system prompt.
- Watch cost and latency. Every extra step is another model call, so don’t chain a task that one good prompt can handle.
When not to use prompt chaining
Chaining adds overhead. For a quick question, a short rewrite or a simple classification, one well-written prompt is faster and cheaper. It also won’t fix bad source material: if Step 1 extracts the wrong facts, later steps will polish the mistake. And because models can still produce errors (see AI hallucination), a review step or human check remains important for anything you publish.
Bottom line
Prompt chaining is the practice of breaking one complex request into a series of focused prompts, each building on the last. It trades a little speed for much more control, accuracy and transparency. Start with two or three steps, define clean hand-offs, add a review step, and you will get noticeably more reliable results from any AI model. For the bigger picture, see our plain-English guide to prompt engineering.

Sources
- Anthropic: Building effective agents
- Claude Docs: Prompting best practices
- AWS Prescriptive Guidance: Workflow for prompt chaining
- Claude Academy: Chaining workflows



