What it is
Prompt chaining means splitting one big job into a series of smaller prompts, where the answer to each prompt becomes part of the next one. Instead of asking an AI to "write me a finished 1,500-word blog post about composting" in one go, you ask it for an outline first. You look at the outline. Then you give it the approved outline and ask for a draft. Then you give it the draft and ask for an edit. Then you give it the edited version and ask it to list every factual claim you should check. Four prompts, each small and clear, linked together like the links of a chain.
The idea is borrowed straight from how people already work. A writer doesn't produce a polished chapter in one sitting from a blank page. They plan, draft, revise, and check, and each stage has a different goal and a different frame of mind. A language model benefits from the same split. When a single prompt asks for planning, writing, tone, fact-checking and formatting all at once, the model has to juggle, and something usually drops. When each prompt asks for one thing, each thing tends to get done well.
A chain has three ingredients:
- Steps. Each step is its own prompt with one job: outline, draft, shorten, translate, check.
- Hand-offs. The output of one step is pasted, or passed automatically, into the next. The hand-off is what makes it a chain and not just a list of separate chats.
- Checkpoints. Between steps you (or a rule, or another prompt) look at the result before moving on. Anthropic's engineering team calls these checks "gates". A gate can be as simple as "does the outline have five sections?" or as human as "do I actually like this angle?"
You can run a chain by hand, copying and pasting between messages in any chatbot. That's how most creators start, and it needs no tools at all. You can also automate it, so that a piece of software sends each prompt to the model in turn. Automation tools such as Zapier and Make, and developer libraries such as LangChain, exist largely to make this kind of hand-off run on its own.
Two neighbours on the table are easy to confuse with chaining, so it's worth being precise.
Chain of thought is one prompt and one reply. You ask the model to reason step by step, and the steps appear inside a single answer. Prompt chaining is several prompts and several replies, with a hand-off between each one. You can use both together: one link in your chain might ask for step-by-step reasoning.
An agent is a system where the AI decides for itself what to do next: which tool to use, which step to take, when it's finished. In a prompt chain, you decide the steps in advance and they run in the same order every time. That makes a chain more predictable and easier to check, and an agent more flexible. Anthropic draws exactly this line in its guide to building agents: chains are "workflows" that follow a path written in advance, while agents direct their own process.
Why it matters
Each step gets the model's full attention. A prompt that asks for one thing is easier to follow than a prompt that asks for six. The researchers behind the "AI Chains" study at Google put it simply: running the same model on several smaller sub-tasks gives each sub-task a better chance of success than solving the whole thing in one go. You're not making the model smarter. You're making each question easier.
You can see where things went wrong. When a one-shot blog post comes back flat, you don't know why. Was the angle wrong? The structure? The tone? With a chain, you have the outline, the draft and the edit side by side. If the outline was weak, you fix the outline and re-run the steps after it. You don't start over from nothing, and you don't have to guess.
You stay in control of the parts that matter. The checkpoints are where your judgement goes. You approve the outline before a single paragraph is written. You decide which of five suggested titles survives. For creators this is the difference between "the AI wrote my post" and "I wrote my post with an AI doing the heavy lifting". The Google study found that people using chains felt significantly more in control and more like they were collaborating, not just pressing a button and hoping.
Some jobs are simply too big for one prompt. A whole book chapter, a long report, or a batch of fifty product descriptions can outgrow what fits comfortably in one exchange. Long inputs and long outputs also raise the risk that the model loses track of details in the middle (see context window). A chain keeps each step small: summarise chapter one, then chapter two, then combine the summaries.
Steps can be reused. Once you have a good "tighten this draft" prompt, you can use it as the third link in every chain you run. Over time you build a small library of reliable steps, which is where prompt templates come in.
It's the foundation of automation. Almost every "AI workflow" you'll see advertised, from turning a podcast episode into show notes to sorting incoming emails, is a prompt chain with some software around it. Tools like Zapier let you add an AI step anywhere in a multi-step automation, so the output of one AI step can feed a second AI step, then a spreadsheet, then an email. Features and plans change often, so check the current details on each tool's own site. Understanding chaining by hand first makes these tools much less mysterious (see workflow automation).
The honest cost is time and effort. A chain takes more messages than one prompt, and if you automate it, it makes more calls to the model, which is slower and can cost more. Anthropic's guide describes the trade plainly: chaining gives up some speed to gain accuracy. For a quick caption or a one-line reply, one prompt is fine. Chaining earns its keep on work you care about getting right.
Real-world examples
"AI Chains": the Google study that tested it with real people (2021 to 2022)
In October 2021, Tongshuang Wu of the University of Washington (working as an intern at Google) and Michael Terry and Carrie J. Cai of Google Research published a paper called "AI Chains: Transparent and Controllable Human-AI Interaction by Chaining Large Language Model Prompts". It was presented at CHI 2022, the main international conference on how people use computers, held in New Orleans in spring 2022.
The paper defined chaining as linking model steps so that "the output of one step becomes the input for the next". Its opening example is a small writing job that will feel familiar. Someone has written blunt feedback about a colleague's presentation, listing three problems, and wants it turned into a friendly paragraph with suggestions. Asked in one prompt, the model produced something vague and impersonal that didn't address all three problems. Split into a chain of three steps (pull out each problem, brainstorm suggestions for each one, then write the friendly paragraph), the same model produced a clearly better result.
The team then ran a study with 20 people from a large software company, including UX designers, linguists and data analysts rather than AI specialists. Each person did a task twice: once with an ordinary single text box and once with a chaining interface, both powered by the same model. One task was the feedback rewrite; the other was building a set of personalised English-French phrase cards for a trip to Paris. Two judges who didn't know which version was which compared the results, and the chained version came out ahead about 82 percent of the time. Participants also rated the chaining tool significantly higher for transparency, control and sense of collaboration.
The researchers noticed people using chains in ways nobody had planned. Some tested a single step on its own, the way a programmer tests one piece of code, to find out which link was causing a bad result. Others ran two versions of a step side by side to compare strategies. That's the practical lesson for anyone chaining by hand: when the end result is wrong, find the weak link and fix only that.
LangChain: a chaining library that took off (October 2022)
In late October 2022, a developer named Harrison Chase, then working at the machine-learning start-up Robust Intelligence, released a small open-source Python package called LangChain as a side project. Its first listing on PyPI, the public catalogue of Python software, dated 25 October 2022, described it as "building applications with LLMs through composability" and promised a way of combining pieces "into a single comprehensive chain". The name says what it was for: linking model calls together.
The timing was lucky. ChatGPT came out five weeks later, millions of people discovered what language models could do, and developers went looking for ways to build real products on top of them. LangChain became one of the most popular tools for doing it. By April 2023 it had become a company and raised venture funding, according to reporting summarised on its Wikipedia page, and the project grew to cover far more than chains.
LangChain matters here less as a product than as a signal. Within weeks of the chatbot boom, one of the first things builders reached for was a way to split work into linked prompts. You don't need LangChain, or any code, to chain prompts. But its rapid take-off shows how quickly people discovered that one giant prompt wasn't enough for serious work.
Anthropic names prompt chaining as the first workflow (December 2024)
On 19 December 2024, Anthropic, the company that makes Claude, published an engineering article called "Building effective agents", written by two of its engineers. It drew on the company's work with many teams building AI products, and it became widely shared because it argued for restraint. Its advice was to find the simplest solution that works and to add complexity only when needed, which "might mean not building agentic systems at all".
The article described five common "workflows", fixed patterns where the steps are set in advance, and prompt chaining was the first. It defined chaining as breaking a task into a sequence of steps where each call to the model processes the output of the one before. It added the idea of gates, meaning checks on intermediate steps to make sure the process is still on track before it continues. It said chaining is ideal when a task can be cleanly broken into fixed subtasks. One of its two examples will look familiar to any writer: write an outline of a document, check the outline against certain criteria, and then write the document from the outline.
The article also carried a warning about frameworks. Tools that chain calls together make it easy to start, it said, but they can add layers that hide the actual prompts and responses, which makes problems harder to find. For a creator, that's a good argument for building your first chains by hand, where every prompt and every answer is right in front of you. Anthropic's current prompting guide for Claude makes a related point: modern models handle much multi-step reasoning on their own, and explicit chaining is still useful when you want to inspect what happens between steps or keep a fixed structure. Its most common pattern is draft, then review against criteria, then refine.
An everyday scenario: the chapter that stopped wandering
This is an illustrative scenario, not a documented case. Imagine Dana, who writes a popular home-cooking blog and is turning it into her first cookbook. Each chapter opens with a 2,000-word essay about a season. Her first attempt was one long prompt: her notes, her tone, the word count, "make it warm but not sappy", and "don't invent any history". The result wandered, repeated itself, and slipped in a confident claim about the origins of a dish that she couldn't confirm anywhere.
She switches to a chain. Step one: from her notes, propose three possible angles for the essay, one paragraph each. She picks one. Step two: outline that angle in five sections with a one-line purpose for each, and she checks that nothing is repeated and every section uses something from her notes. That's her gate. Step three: draft one section at a time from the approved outline. Step four: edit the combined draft for her voice, using three paragraphs of her own published writing as examples. Step five: list every factual claim in the edited draft, so she can check each one herself before it goes to her editor.
The essay takes longer to make, maybe forty minutes instead of five. But it doesn't wander, because the outline was fixed before any writing started. And the questionable food-history claim shows up on the step-five list, where she can check it, instead of hiding in the middle of a paragraph.
Try it yourself
You need a chatbot (any of the major ones works, including free versions at the time of writing) and a topic you'd genuinely like to write about. This chain produces a short blog post, but the same four steps work for a newsletter, a book section or a long social post. Allow about 30 minutes.
Use a single conversation, so the model can see earlier steps, or paste each result into a fresh chat if you prefer a clean slate for every step. Both work. The fresh-chat approach makes the hand-off more visible and is a good way to learn.
- Step one: the outline. Paste this, filling in the brackets:
I'm writing a blog post of about 800 words for [who reads your blog].
Topic: [your topic].
My angle or opinion: [one sentence].
Write an outline only, not the post. Give me a working title,
then 4 or 5 sections. For each section, give a heading and one
sentence saying what it will cover and why the reader needs it.
- Step two: the gate. Before you write anything, check the outline. Read it yourself first, then paste it back with this prompt:
Check this outline against these rules and reply PASS or FAIL for each,
with one short reason:
1. Every section supports the angle: [your angle].
2. No two sections cover the same ground.
3. The first section gives the reader a reason to keep reading.
4. Nothing in it depends on a fact or statistic I haven't supplied.
If anything fails, suggest a fixed outline. If everything passes, say so.
Outline:
[paste the outline]
Don't move on until you're happy with the outline. This step is where most of the quality of the final piece is decided, and it's far cheaper to fix a heading than a finished paragraph.
- Step three: the draft. Paste the approved outline with this prompt:
Write the blog post from this approved outline. Keep to the sections
and their order. About 800 words. Plain, friendly language for
[your readers]. Short paragraphs. Do not add statistics, dates or
quotes; if a point needs one, write [CHECK: what's needed] instead.
Outline:
[paste the approved outline]
The "[CHECK]" instruction matters. It tells the model to leave a visible gap instead of filling it with something invented (see hallucination).
- Step four: the edit and fact list. Paste the draft with this prompt:
Edit this draft. Cut any sentence that repeats an earlier point,
tighten wordy phrases, and make the opening line stronger. Keep my
meaning and keep it about 800 words. Then, under the heading
"Facts to check", list every factual claim in the edited version
and every [CHECK] marker, one per line.
Draft:
[paste the draft]
- Do your own check. Go through the "Facts to check" list and verify each item against a reliable source, or cut it. This is the human gate, and no step in the chain replaces it.
- Compare. For the full lesson, open a fresh chat and ask for the whole post in one prompt with the same topic, angle and length. Put the two versions side by side. Notice where the chained version is tighter, more on-angle, or easier to trust, and notice where the single prompt did just as well. Both findings are useful.
- Save your links. If a step worked well, save that prompt in a note with the brackets left in. Next time, you're not starting from scratch. You're running a chain you've already tested, and you can improve one link at a time, ideally with a small set of test cases (see evals).
Common mistakes and misunderstandings
Confusing it with chain of thought. The names are close, and the ideas are different. Chain of thought asks for step-by-step reasoning inside one answer. Prompt chaining splits the job into separate prompts with hand-offs between them. If you're sending one message, you're not chaining.
Skipping the checkpoints. A chain with no gates just passes mistakes along faster. If the outline is off-angle, the draft, the edit and the fact list will all be off-angle too, and they'll look polished while they're at it. The value of chaining comes from stopping to look between steps. At the very least, read each output before you feed it forward.
Making too many links. Not every task needs five steps. Each hand-off takes time and is a chance for detail to get lost. A two-step chain (draft, then edit) is often enough. Split a task when a single prompt is visibly struggling, not because more steps sounds more professional.
Handing off too little. Each step only knows what you give it. If step three receives the outline but not your notes on audience and tone, it will guess, and the draft will drift. When you paste into a fresh chat, include whatever that step needs to do its one job well.
Handing off too much. The opposite problem is pasting every earlier output into every later step until the prompt is long and cluttered. The model then pays attention to the wrong things. Pass along only what the next step actually uses. Clearly labelled sections help here (see XML tags).
Thinking a chain is an agent. A chain follows the steps you wrote, in the order you wrote them, every time. It can't decide to go and look something up or skip a step it thinks is pointless. That predictability is a strength. If you need the AI to choose its own steps, that's an agent, and it comes with more flexibility and less control.
Letting the model check its own facts and calling it verified. A "fact-check" step inside the chain is useful for finding claims. It isn't useful for confirming them, because the same model that made a mistake can be just as confident when reviewing it. Use the model to list what needs checking, then check it yourself against real sources.
Automating before it works by hand. Tools like Zapier and Make will happily run a broken chain a thousand times. Run your chain by hand on a few real examples first, fix the weak links, and only then automate it. Anthropic's article gives the same advice in its own way: start simple, and add layers only when you can see they help.
Assuming it's always better. Chaining is slower and uses more of the model's time. Modern models are also better at handling multi-step tasks in one go than they were in 2021. For a short caption or a quick reply, one clear prompt is often best. Chain when the work is long, when the steps need different frames of mind, or when you need to check the middle.
Related elements
- Prompt: the building block of every link in a chain.
- Chain of Thought: step-by-step reasoning inside a single prompt, often confused with chaining.
- Prompt Templates: reusable prompts with blanks to fill, which make good links.
- Self-critique: asking the model to review its own output, a common middle link in a chain.
- Iterative Refinement: improving a result over several rounds, which chaining gives a fixed structure.
- Evals: testing each link on a set of cases, so you know which one to improve.
- Context Window: the limit on how much the model can handle at once, which chaining helps you work within.
- Agent: the flexible alternative where the model chooses its own steps instead of following yours.
- Workflow Automation: running a chain automatically with software, once it works by hand.
- Orchestration: coordinating many steps, tools or agents, the bigger system a chain can grow into.
- Human in the Loop: the person at the checkpoints, and why the final fact-check stays with you.