technique

Prompt chaining

Prompt chaining splits a complex task into a sequence of smaller LLM calls — each step's output feeds the next — improving reliability over a single mega-prompt.

Instead of asking the model to do everything in one prompt, prompt chaining decomposes a task into discrete steps (extract → classify → summarise → format). Each step is its own LLM call with focused context, simpler instructions, and easier evals. The technique dramatically improves reliability on complex workflows because each step is independently testable and replaceable. Modern agent frameworks (LangGraph, OpenAI Agents SDK, Mastra) treat prompt chaining as the foundation pattern. Best practice in 2026: chain when steps need different models or independent quality control; keep within one prompt when the task is simple enough for end-to-end quality to be good.

When to use prompt chaining

Common mistakes

FAQ

What is prompt chaining?

Prompt chaining splits a complex task into a sequence of smaller LLM calls — each step's output feeds the next — improving reliability over a single mega-prompt.

When should I use prompt chaining?

Complex workflows where a single prompt fails reliability tests. Tasks where intermediate steps need to be inspected or branched.

What are the most common mistakes with prompt chaining?

Over-chaining trivial tasks — adds latency and cost without benefit. Skipping per-step evals — chains hide where quality fails.

Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/prompt-chaining.md.