---
title: 'Prompt chaining'
description: "Connecting multiple model calls so one stage's result becomes context or input for a later stage."
canonical_url: 'https://darkfactory.dev/glossary/prompt-chaining'
markdown_url: 'https://darkfactory.dev/glossary/prompt-chaining.md'
collection: glossary
date_published: '2026-08-03T00:00:00-04:00'
date_modified: '2026-08-26T00:00:00-04:00'
---

# Prompt chaining


## Definition

Prompt chaining divides a task into an ordered series of model calls. Each stage has a narrower job, and its result becomes input or context for a later stage. An application can validate, transform, reject, or route the intermediate result before continuing.

A document workflow might generate an outline, check it against editorial rules, draft from the approved outline, and then extract citations. The useful unit is not merely several prompts in a row. It is the explicit contract between stages: what each call must produce, how that result is checked, and what happens when it fails.

## Origin and usage

There is no well-supported single coiner for the phrase. Anthropic's 2024 engineering guide helped standardize the current workflow meaning: a fixed sequence in which each model call processes the previous output, optionally with programmatic gates between calls. The guide frames the pattern as a trade of additional latency for higher accuracy when a task decomposes cleanly.

## Operational significance

Chaining can make difficult work easier to inspect because each call handles a smaller problem and intermediate artifacts can be tested. It also creates new failure paths. A plausible error in the first stage can become authoritative context for every later stage, while extra calls add cost and latency. Persist provenance, validate at boundaries, and stop the chain when a required intermediate contract is not met.

## Distinguish it from nearby terms

- A single prompt asks one call to perform the task without an application-controlled intermediate boundary.
- An agent loop lets model output or environment state influence which action happens next. A prompt chain usually has predefined stages even when a stage can fail or branch.
- Chain-of-thought prompting asks one model response to express or use intermediate reasoning. Prompt chaining coordinates separate calls.

## Check your understanding

An outline stage invents a source and the drafting stage repeats it. Name the boundary where the chain should have stopped and the evidence that should have been checked there.

## Related terms

- [Prompt](https://darkfactory.dev/glossary/prompt)
- [Structured output](https://darkfactory.dev/glossary/structured-output)
- [Context engineering](https://darkfactory.dev/glossary/context-engineering)

## Related factory areas

- [Orchestration, state, concurrency & recovery](https://darkfactory.dev/factory/orchestration-state)

## Evidence and further reading

- [Google Machine Learning Glossary](https://developers.google.com/machine-learning/glossary/)
- [Building Effective AI Agents](https://www.anthropic.com/engineering/building-effective-agents)
