Prompt chaining splits an LLM task into a sequence of prompts, each feeding the next. How it works, examples, and how it differs from chain-of-thought.

Updated October 2026
Prompt chaining is a technique for large language models (LLMs) that splits a task into a sequence of smaller prompts, where each prompt's output becomes part of the next prompt's input. Instead of one prompt that has to plan, write, and check its own work at once, a prompt chain gives each model call one job. Each result can be checked before it goes to the next prompt.
In a 2024 study of text summarization, researchers Sun and colleagues found that a chain of three prompts (draft, critique, refine) produced better summaries than one prompt that asked for all three steps.
This content was generated with the assistance of AI. Our AI prompt chain workflow is carefully grounded and preferences .gov and .edu citations when available. All content is reviewed by a Telnyx employee to ensure accuracy, relevance, and a high standard of quality.
A prompt chain is a series of LLM calls in which code passes each call's output to the next. In an AI agent, by contrast, the model chooses its own next step as it runs.
The term chaining comes from human-computer interaction research. Researchers Wu, Terry, and Cai introduced it in AI Chains, a paper presented at the CHI 2022 conference. They described LLM steps linked so that the output of one step becomes the input for the next.
Outside that research, prompt chaining also goes by chain prompting and LLM chaining.
The word chaining has an older meaning in AI, unrelated to prompts. Forward and backward chaining are the ways a rule-based inference engine applies if-then rules to facts.
A prompt chain works through handoffs and gates between its model calls. In a handoff, code inserts one call's output into the next call's prompt.
In a gate, code checks that output before passing it on. Anthropic's guide to building agents uses the same word for these programmatic checks.
A chain that turns a support call transcript into a follow-up email shows each step in order:

Each step sees only what it needs. The write step works from checked fields instead of the raw transcript, so it has no transcript to misread. An extraction that fails stops at a check instead of reaching the customer.
In Python, the extract step, its gate with one retry, and the write step take about 30 lines:
A common prompt chaining example is draft, review, refine: one call writes a draft, a second reviews it against stated criteria, and a third revises it using that review.
Anthropic's Claude prompting guide names this self-correction chain as the most common chaining pattern.
Other chains follow the same rule of one job per call:
Prompt chains come in four shapes: sequential, branching, parallel, and looping. In all four, every possible path is set in code before the chain runs.

Anthropic's guide reserves the name prompt chaining for the sequential shape and calls the other three routing, parallelization, and evaluator-optimizer.
A model can choose among those paths, as the classify call does, but can't add a new one. That is the line between a chain and an agent.
Building a prompt chain starts with choosing where to split. Good split points are places where a step's output can be checked in code, or where the next step needs only a small part of the input. Seven practices keep a chain reliable:
A single prompt is the better choice when one model call can do the task reliably. A prompt chain earns its extra calls when the task has distinct steps that fail in different ways or need checking along the way.
Anthropic's agents guide describes the same trade: a chain gives up some latency for accuracy by making each call an easier task. It also notes that for many applications a single well-built call, with retrieval and in-context examples, is enough.
Scoring a single prompt field by field on a labeled set of real inputs shows whether it needs a chain. If its failures cluster in one step, such as dropped dates, that step is the place to split.
The strongest single-prompt alternative asks for the fields and the email together as one JSON object, then validates it in code. That design gets a check without a second call. A failed check reruns the whole job, where a chain retries only the step that failed.
A chain gives a developer four things a single prompt can't:
A chain's tokens are the sum of each call's input and output. Its latency is the sum of its sequential calls, plus any retries.
Latency matters only when someone waits on the result. No one waits on a follow-up email, but a voice reply has a caller on the line.
Errors compound across steps in either design. If each of four sub-steps is right 95% of the time and failures are independent, all four are right only about 81% of the time (0.95 multiplied by itself four times).
A single prompt gives no place to catch the failed step. A chain's gates catch the failures code can detect, such as a missing field, and retry that step with the problem named.
A single prompt also degrades as it grows. Telnyx's guide to voice AI prompts describes a prompt that keeps absorbing edge cases until it becomes hard to test. Splitting it into steps is one way out.
The difference between prompt chaining, chain-of-thought prompting, and an AI agent is who decides the next step: the developer's code, the model inside a single response, or the model at run time.
Prompt chaining splits a task across several model calls. Chain-of-thought prompting keeps the task in one call and asks the model to write out its reasoning steps before it answers.
The difference is where a mistake can be caught. A chain has a join between steps where code can check the output. Chain-of-thought reasoning happens inside one response, so nothing outside the model can stop a wrong step.
Chain-of-thought works on its own for reasoning that fits in one answer.
Any step in a chain can also use chain-of-thought prompting, or a reasoning model that writes its chain of thought on its own. Providers bill those hidden reasoning tokens at output rates, as Telnyx's guide to LLM APIs notes.
A prompt chain follows a plan written in code. An AI agent lets the model make the plan as it goes.
An agent built on the ReAct pattern, for example, alternates reasoning with actions such as a search. It picks each next action from what the last one returned.
A chain fits a task whose steps are known ahead of time. An agent fits a task whose steps depend on what the model finds.
Orchestrator-workers falls between a chain and an agent: a central model splits the task at run time and hands the pieces to worker models. Several models working together this way form a multi-agent system.

A prompt chain in a voice AI agent keeps one model call inside each conversation turn and moves its other steps before or after the reply. Every extra call inside the turn is silence the caller hears.
The turn already spends time on transcription, the model, and speech, which Telnyx's guide to orchestration tools counts as one latency budget.
A chain's steps can run in three places:
Telnyx voice AI agents follow this pattern through conversation workflows, which split a call into steps, each with its own instructions and, where it helps, a faster model.
After the call, post-conversation processing gives the assistant one more model turn for wrap-up work. It is in beta.
Teams that build their own chain can run it on the Voice API, which handles call control and streams the call's audio to their own pipeline.
Prompt chaining in Claude means splitting a task into separate Claude API calls, with each call's output passed into the next. Anthropic's standard example is a draft, review, and refine chain.
Anthropic's prompting guide says Claude now handles most multistep reasoning within a single request. Explicit chaining is still useful, it adds, when a developer needs to inspect intermediate outputs or enforce a specific pipeline structure.
LLM chaining is another name for prompt chaining: connecting several large language model calls so that each call's output becomes input to the next.
An LLM chain can also mix model calls with other steps, such as a database lookup or a plain function. Researchers Khot and colleagues designed decomposed prompting so any sub-task prompt can be swapped for a trained model or a symbolic function.
LangChain builds a prompt chain by joining components with the pipe operator, as in prompt | model | parser. The result is a RunnableSequence, in which each component's output is the next one's input.
LangChain calls this composition style the LangChain Expression Language (LCEL). Its older chain classes, such as LLMChain, are deprecated and moved to the langchain-classic package in LangChain v1.
Telnyx Inference can fill the model slot through LangChain's ChatOpenAI class pointed at the Telnyx base URL.
Forward chaining starts from known facts and applies every if-then rule whose conditions are met, adding each conclusion as a new fact until it reaches the goal. Backward chaining starts from the goal and works back to the facts that would prove it.
Both are inference methods for rule-based systems, described in Russell and Norvig's AI textbook. Neither involves prompts. Prompt chaining borrows only the word.
Prompt chaining is still useful with reasoning models when a task needs checkpoints outside the model. A reasoning model works through a multistep problem inside one call.
A chain built only to make a model reason step by step may no longer be needed. A chain still adds what a single call can't: a code check between steps, a different model for each step, and intermediate outputs a developer can log and test.