Prompt chaining
Prompt chaining splits a task into a fixed sequence of separate model calls, where the output of each step becomes the input to the next, often with checks in between.
Asking a language model to do a complicated job in one go often produces something that is almost right. Prompt chaining breaks the job into steps and gives each step its own call to the model. Step one writes an outline. Step two checks the outline against a list of requirements. Step three writes the document from the approved outline. Each call has a narrower, easier task, and the program that runs the chain passes the result of one step into the prompt for the next.
The idea was studied early. In October 2021 researchers Tongshuang Wu, Michael Terry and Carrie Cai published AI Chains, which linked model steps so that each output fed the next. In a study with 20 participants, chaining improved the quality of results and made people feel the system was more transparent and controllable, partly because they could inspect and fix individual steps instead of rewriting one giant prompt.
Anthropic's December 2024 guide to building agents lists prompt chaining first among its workflow patterns. It recommends it when a task splits cleanly into fixed subtasks, and describes the deal plainly: you accept extra time, because there are several calls, in return for higher accuracy. Its examples include writing marketing copy and then translating it. Between steps, the program can run ordinary code checks, called gates, that stop the chain if something has gone wrong.
A very common chain is draft, critique, revise. Anthropic's prompting documentation describes it as generating a draft, having the model review that draft against criteria, then having it refine the draft based on the review, with each step a separate call so it can be logged and evaluated. That separation is the practical appeal. When the final answer is bad, you can see which link broke.
Chaining is a fixed path set by the developer, which is what separates it from an agent that decides its own next step. The same documentation notes that newer models handle much multistep reasoning internally, so explicit chains are still useful when you need to inspect intermediate outputs or enforce a particular pipeline structure.
It is the practice of breaking a task into a sequence of separate model calls, with each call's output passed into the next prompt. Each step handles a smaller, clearer task, and the developer can check results between steps. In a chain, the developer fixes the steps and their order in advance. An agent decides for itself which step or tool to use next based on what it finds. Chains are more predictable and easier to debug; agents are more flexible for open-ended problems. Often, for tasks that split naturally into stages, because each call has an easier job and errors can be caught between steps. The cost is more calls, which means more time and usually more money per task. A gate is a check placed between two steps of a chain, usually ordinary code, that confirms the previous output meets some condition before the chain continues. If the check fails, the chain can stop, retry or take another path.Common questions
What is prompt chaining in AI?
What is the difference between prompt chaining and an AI agent?
Does prompt chaining make results better?
What is a gate in prompt chaining?
Search for "prompt chaining", "LLM workflows", "AI Chains" or "draft critique revise prompting" to see how the pattern is used. The best guidance comes from model makers' developer documentation and engineering blogs, and from human-computer interaction research that measures how chains affect quality and control. Framework tutorials are useful for code, but check whether a given library is adding complexity a short script would not need.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.