---
title: Prompt Chaining — Prompt Engineering Technique
description: Prompt chaining splits a complex job into a sequence of prompts where each step's output feeds the next. Smaller, focused calls are more reliable and easier to debug than one monolithic prompt.
canonical: https://prompeteer.ai/techniques/prompt-chaining
category: Agentic & tool use
---

# Prompt Chaining

Prompt chaining splits a complex job into a sequence of prompts where each step's output feeds the next. Smaller, focused calls are more reliable and easier to debug than one monolithic prompt.

## What it is

Prompt chaining breaks a task into an ordered pipeline of model calls. Each call handles one well-scoped subtask, and its output becomes the input to the following call. Rather than asking a single prompt to plan, draft, critique, and format all at once, the work is staged.

This improves reliability because each step is simpler and its output can be validated before proceeding. It also makes systems observable and debuggable: when something goes wrong you can pinpoint the failing stage, and you can swap, retry, or add a step without rewriting the whole prompt.

## When to use

- A task has distinct phases (extract → transform → summarize → format).
- A single mega-prompt is unreliable, hard to debug, or exceeds context limits.
- You want to validate or transform intermediate output between steps.
- Different steps benefit from different settings, models, or tools.

## How it works

1. Decompose the task into ordered, single-responsibility subtasks.
2. Write a focused prompt for each subtask with a clear, parseable output.
3. Pass each step's validated output as the input to the next prompt.
4. Add checks or transformations between steps and handle failures per stage.

## Illustrative structure

The structure is a pipeline: prompt_1(input) → output_1 → prompt_2(output_1) → output_2 → prompt_3(output_2) → final. For example: an "extract key claims" step feeds a "verify each claim" step, which feeds a "write summary" step.

## Pitfalls

- Errors compound: a bad early output degrades every later stage.
- More calls mean more latency and cost than a single prompt.
- Passing full context between steps can bloat tokens; pass only what the next step needs.
- Requires orchestration code and per-step error handling.

## Sources

- [Anthropic — Chain complex prompts for stronger performance](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/chain-prompts)
- [OpenAI — Strategy: split complex tasks into simpler subtasks](https://platform.openai.com/docs/guides/prompt-engineering)

## Related techniques

- [task-decomposition](https://prompeteer.ai/techniques/task-decomposition)
- [react](https://prompeteer.ai/techniques/react)
- [structured-output](https://prompeteer.ai/techniques/structured-output)
