AI courses in English and Dutch, with certificate AI literacy you can evidence under the EU AI Act Invoice in your employer's name, also for teams
Black Friday33% off every e-learning and team plan, from 4 to 30 November (Cyber Monday)33% off until 30 Novends in 0d 0h 0mView the e-learnings

Prompt chaining: what it is, three patterns and examples

Prompt chaining: what it is, three patterns and examples

Prompt chaining is a technique in which you break a complex task down into several smaller prompts that follow one another. The output of the first prompt becomes the input for the second, and in this way you build towards a final result step by step. Instead of asking for everything at once, you guide the AI model through a process.

If you work with ChatGPT or Claude regularly, you will recognise the problem: a long prompt with ten instructions rarely produces a result that is right on every point. Prompt chaining solves this by giving each step focused attention. The technique belongs to the wider discipline of prompting.

How does prompt chaining work?

Building a chain starts with identifying the subtasks within your task. Say you want to write an internal advisory report based on three source documents. Instead of sending one prompt saying “analyse these sources, identify the key insights, write a summary and formulate a recommendation”, you split it into separate steps.

The first prompt focuses solely on analysing the sources. You ask the model to list the key points of each document, without interpreting or summarising yet. The second prompt takes those key points as input and asks the model to identify patterns and contradictions. What comes up in every source, and where do they contradict each other? The third prompt turns that analysis into a recommendation for a specific audience, for example the management team. Only at this step do you give instructions on tone, length and structure.

The principle is the same in every prompt chain: each step has exactly one goal, and the output of one step feeds the next. This creates a pipeline in which the final result is better than what a single prompt would produce. In the Python tools I run on my own VPS with the Claude API, every workflow is built from prompt chains; one giant prompt does not work in an automated context, because the output becomes unpredictable and you cannot validate where something goes wrong. You can build a chain like this yourself in the AI Automation Course with Claude, first without code and then, if you like, in Python.

Three prompt chaining patterns

There are three commonly used patterns. Which one you choose depends on the structure of your task and how much control you need.

AI knowledge base
Three prompt chaining patterns
Linear chain
Prompts run in order, each building on the result of the previous step.
Parallel chain
Several prompts run at once, for example the four parts of a SWOT analysis, then a final prompt combines them.
Self-correction chain
Draft, assess against your criteria, then revise based on that assessment.

Linear chain

A linear prompt chain is the most widely used pattern. Each prompt runs in order and builds on the result of the previous step. This works for tasks with a natural step-by-step progression, such as the advisory report example above. The strength of a linear chain lies in its clarity: each step has one predecessor and one successor, and once the chain is in place you can reuse it for similar tasks.

Parallel chain

A parallel prompt chain runs several prompts at the same time, each focused on a different aspect of the same task. You then combine the results in a final prompt. This works when you need independent analyses that you want to merge into one conclusion, for example a SWOT analysis in which strengths, weaknesses, opportunities and threats are each worked out separately. The advantage of parallel chains is speed; the drawback is that you cannot make corrections between the parallel steps.

Self-correction chain

A self-correction prompt chain has the model first generate a draft, then assess that draft against criteria you provide, and then revise the result based on that assessment. This pattern is effective for writing tasks where you want to raise the quality iteratively without reviewing every version by hand. The chain works best when you give explicit assessment criteria, because without a clear yardstick the model often produces a second version that is not materially better than the first.

Why does prompt chaining produce better results?

Chaining improves output because it concentrates the model’s attention on one step at a time. A language model that processes ten instructions at once gives some more weight than others. That leads to output that is good on three points and mediocre on seven. Short, focused prompts prevent that dilution. Each prompt gets the model’s full attention, so the quality of each step is higher.

The second advantage is easier troubleshooting. If step three of your chain produces a weak result, you rerun only that step. With one big prompt, you start again from scratch without knowing which part caused the problem. You can make targeted adjustments instead of repeating everything.

The third advantage is that you can improve the quality of your prompt step by step. If a particular step consistently produces mediocre output, you only adjust that prompt.

Prompt chaining versus chain-of-thought prompting

Prompt chaining and chain-of-thought prompting look alike, but they work very differently. The difference lies in where the reasoning process takes place: spread across several prompts, or within a single prompt.

With chain-of-thought prompting, you ask the model to work through the problem step by step within one prompt. You add an instruction such as “reason step by step” and the model goes through the whole reasoning process in one answer. This works well for logic problems, calculations and analyses that need a clear line of reasoning.

With prompt chaining, you split the task across several separate prompts. Each prompt is its own interaction, and you assess the intermediate result before you start the next step. This gives you more control over the process, but also takes more time. In practice, chaining adds most value for tasks where the output goes to someone else, such as reports, quotes or communications.

The two techniques are not mutually exclusive. Within a prompt chain, you can use chain-of-thought at a specific step, for example when that step requires a complex trade-off.

A practical example of prompt chaining

A realistic example shows how the technique works in practice. Say you are a communications adviser who has to write a press release about an organisational change. The board has sent you an internal memo with the details.

Prompt 1: “Read this internal memo and identify the five most important facts that need to be in the press release. No interpretation, just facts.”

Prompt 2: “Rank these five facts by relevance to an external audience. Which fact belongs in the opening paragraph, and which ones support it?”

Prompt 3: “Write a press release of no more than 300 words based on this ranking. Use a businesslike tone. The opening sentence contains the most important fact. Do not make up any quotes.”

Prompt 4: “Check this press release for factual consistency with the original memo. Are there any claims that cannot be traced directly back to the memo? If so, flag them.”

Each step has one function: extracting facts, prioritising, writing, verifying. The fourth step is a built-in check that you do not have with a single prompt. You see exactly what the model changes or adds, and you can step in before the press release goes out.

A second practical example: a project manager has to draw up a risk analysis. The first prompt lists all the risks based on the project plan. The second prompt categorises those risks by likelihood and impact. The third prompt formulates a mitigation measure for each risk. The fourth prompt brings everything together in a structured overview that can be used straight away in a steering group meeting.

The self-correction chain works differently. Say you have to write a quote. Prompt 1 generates a first version based on your brief. Prompt 2 assesses that version against criteria you provide: “Check whether the quote contains a clear problem statement, describes a specific approach and gives a substantiated price.” Prompt 3 rewrites the quote based on that assessment. The model corrects its own output, so you need fewer rounds of manual revision.

Chains like these work the same way in ChatGPT, in Anthropic’s Claude and in other language models. It is not about which model you use, but about how you divide up the task. The structure of the chain determines the quality of the result.

Tips for setting up a prompt chain

A good prompt chain stands or falls by a few rules of thumb. If you apply them, you avoid the most common mistakes and build chains that work reliably time after time.

Split as soon as a prompt tries to do two things at once. “Analyse and summarise” are two operations that each need a different instruction. Turn them into two prompts, so you can adjust each step if the output is not right.

Limit your chain to five steps at most. Longer chains increase the chance that context gets lost or that small errors pile up. If you need more than five steps, the original task is probably defined too broadly.

Be explicit about how the model should use the previous output. “Use the result of the previous step” is too vague. “Take the five key points from the previous step and rank them by urgency” gives the model a clear instruction.

Build in an evaluation step after critical intermediate steps. A question such as “have any facts been left out or added compared with the original input?” is enough to catch errors early, before they spread through the rest of the chain.

Test each step on its own before you run the full chain. A prompt that works well in isolation but gives an unexpected result in combination with the previous output is easier to debug if you have tested it separately first. For every new chain I build, I log the intermediate results of each step so that I can later trace where a chain went off the rails. It is easy to set up and saves a lot of debugging time in the long run.

When to use prompt chaining

Prompt chaining is not the right approach for every task. The technique makes sense for tasks that involve several operations or different types of output. Think of work that combines research, analysis, creation and verification in one end product.

For simple tasks, a chain is unnecessary. If you ask an AI model to summarise a set of meeting notes, it does not need a chain of four prompts. One well-written prompt with clear instructions on length, tone and structure is enough.

A good rule of thumb: if you can describe the task in one sentence without using the word “and”, a single prompt is probably enough. “Summarise these notes” is one task. “Analyse this report, identify risks and write a recommendation for the board” is three tasks that benefit from prompt chaining.

Professionals who are just starting to chain prompts often make the mistake of building chains that are too long. A chain of eight steps sounds thorough, but in practice context gets lost after step five. Start with chains of two or three steps and extend them once you notice the results improving.

Another common mistake is not passing on enough context between steps. Do not assume the model retains everything. With every new prompt, include the relevant context the model needs to carry out the task.

Frequently asked questions about prompt chaining

Prompt chaining also raises questions that go beyond the technique itself.

Is prompt chaining the same as an AI agent?

No, prompt chaining is not an AI agent, because in a chain the steps are fixed in advance. Anthropic calls prompt chaining a workflow: the language model follows a predetermined path in which each call processes the output of the previous one. With an agent, the model decides for itself which steps and tools it uses. According to Anthropic, a chain suits tasks that can be neatly divided into fixed subtasks.

Is prompt chaining slower than a single prompt?

Yes, prompt chaining is usually slower than a single prompt, because each step is a separate call to the model. Anthropic describes that extra waiting time as a deliberate trade-off: you give up speed for accuracy, because each call gets a simpler task. Between the steps, you can build checks into your code that verify whether the process is still on track.

Do you still need prompt chaining with models that have a reasoning step?

Prompt chaining remains useful with models that have a built-in reasoning step, but less often than before. According to Anthropic’s prompting guidelines, Claude with adaptive thinking handles most multi-step reasoning internally. An explicit chain of separate calls keeps its value when you want to inspect intermediate results or enforce a fixed order of steps.

From one-off prompts to a fixed way of working

A chain forces you to think about the structure of your task in advance. Which steps are needed? In what order? Where is the risk of errors? That preparation makes the difference between ad hoc prompting and a repeatable way of working.

A prompt chain that works well for writing an advisory report can be reused next time. Document your chains and build up a library of workflows that work. AI models deliver the best results when you structure the process, not when you improvise from scratch each time.

Such a library does not have to be complicated. A document listing, for each type of task, the steps, the prompts and notes on what did and did not work is enough. After a few weeks, you will have a collection of chains you can use straight away without rethinking the structure every time. Once colleagues start using that library too, you are taking the step towards AI implementation in teams, with a clear owner for each chain and version control so that nobody quietly starts making their own variant.

The ChatGPT Course covers prompt chaining as part of a complete way of working with repeatable workflows and checkpoints. A practical starting point you can use today: take a task you have to do this week anyway and would normally handle in one prompt. Split it into three steps, run each step separately and compare the output. That one experiment turns prompt chaining from a concept into a workable technique in your own work. LearnLLM was set up to teach professionals exactly that kind of repeatable AI workflow, instead of one-off tricks that are quickly forgotten.

Related articles

Rol toewijzen AI prompt
Prompt engineering
Dennis van de Velde

Role prompting: how to assign a role in a prompt

Role prompting means telling an AI model which expertise to answer from. Learn the four elements of a good role, examples from real work and the mistakes to avoid.

AI act
Prompt engineering
Dennis van de Velde

Context engineering: how to give an LLM good context

Context engineering means giving an LLM exactly the information it needs, and no more. Learn how to structure your context and which mistakes lead to generic answers.