Prompt Chaining: Break a Complex Task into a Chain of Prompts
One giant prompt often backfires. With prompt chaining you split the task into small, independent steps, each in a new chat, and optimize every link on its own.
When a task is complex, the natural temptation is to write one huge prompt and expect a perfect result. It tends to backfire: the context window grows, hallucinations become more likely and the model may forget or ignore instructions. The alternative is prompt chaining.
What is prompt chaining?
It's splitting a complex task into a sequence of smaller, independent prompts, where the output of each step becomes the input of the next. Three core rules:
- Each step is its own independent prompt with one clear purpose.
- The output of one step is copied into the next step.
- Each new step runs in a NEW chat, which keeps the context window clean.
The analogy is a car factory assembly line. Nobody says "I want a car" and expects it to appear fully built: there's a station for the body, the doors, the electrical system, the engine and the upholstery, and each produces a defined output that the next one needs. Applied to LLMs: don't ask for "a marketing strategy for next quarter" in one prompt. Build it station by station.
How it differs from related techniques
In chain of thought and self-consistency, reasoning step by step happens inside a single conversation. In prompt chaining, each step is physically separated into a distinct interaction (a new chat).
Why not do it all in one conversation? Because the context window grows with every message, and the larger it gets, the more the model can make errors, hallucinate and lose track of earlier instructions. Separate chats keep every interaction focused and precise.
Example 1: content workflow
Goal: turn a blog article into Instagram posts.
- Extract the key points from the article.
- Convert each point into an Instagram post.
- Create the graphic for each post.
- Write the caption that accompanies each graphic.
Each output feeds the next link until the content is ready to publish.
Example 2: climate change report
Source: Climate Change Committee (England) report, April 2025. Goal: a 100-word summary of the causes, effects and solutions of climate change. Instead of uploading three files and asking for the summary directly, use three steps:
Step 1 (Extraction). Upload the documents and ask ONLY for the five most important points.The model returns five key messages with supporting quotes.
Step 2 (Classification). In a NEW chat, paste those five points and ask the model to organize them into categories: progress, recommendations and impact.
<points>
...output of step 1...
</points>XML tags are used to clearly delimit where the data starts and ends.
Step 3 (Synthesis). In ANOTHER new chat, paste the classification and ask for the 100-word summary focused on the most viable solutions.Final result: a summary including measurable targets by sector, interdepartmental coordination with a resilience mandate, and mainstreaming of adaptation into planning and regulation.
The real advantage: independent iteration
Each link in the chain is a separate prompt that you can improve on its own. Extraction not precise enough? Fix only that prompt. Categories not what you need? Adjust only the classification prompt. It's like calibrating each machine in the factory separately so the final car comes out right.
Step N prompt = [Clear role/task] + [Output format] + <data> output of step N-1 </data>Key takeaways
- One prompt per task, one task per chat.
- Pass only the necessary output forward (a clean, minimal context).
- Use XML tags to delimit the data you paste between steps.
- Debug and refine each link independently.
- The natural next step after mastering chain of thought: split those reasoning steps into separate chats.