Animation10 min

Prompt Chaining

Decomposing a task into a fixed sequence of LLM calls.

Prompt chaining decomposes a task into a fixed sequence of LLM calls, where each call processes the previous call's output. The path is drawn before any input arrives — no node chooses the route. That's the signature of a workflow: your code owns the flowchart, the model fills in the boxes.

The animation follows a document through a writing pipeline: an outline node, then a gate, then draft, then polish. Each node lights up as its call runs, and the intermediate output is visible on the edge leaving it — that visibility is a real advantage of chaining, since every intermediate artifact can be logged, inspected, and evaluated.

Watch the gate closely. A gate is programmatic code between calls — not another LLM — checking the outline against criteria before the pipeline continues. When a weak outline arrives, the gate bounces it back instead of letting a bad foundation flow downstream. A gate is a guarantee: nothing proceeds until the check passes.

Also notice what chaining costs: the steps run one at a time, so total latency is the sum of every call. You're trading latency for accuracy — each call does one simple job well instead of one call juggling everything.