Prompt chaining
Break one job into ordered steps, each feeding the next.
How it works
- 1Decompose the task into a fixed sequence of subtasks.
- 2Run each subtask as its own focused call with only the context it needs.
- 3Pass each output straight into the next step as input.
- 4Optionally add a programmatic check between steps to catch failures early.
Use it when
The task has clean, predictable stages where each output is the next input — draft then edit, extract then format. You trade a little latency for much higher accuracy per step.
Reach for something else when
Steps don't depend on each other (parallelize instead), or the path changes per input (route instead).
Where you stay in the loop
You design the chain and define each step's success check; the agent executes within those rails. Stay in the loop by reviewing intermediate outputs — a wrong early step quietly corrupts everything downstream.
In the wild
Generate marketing copy → verify it matches brand rules → translate the approved copy. Each step is simpler and easier to check than one mega-prompt.
Hand this to your agent
You are running a prompt-chaining workflow. I'll give you a task. Decompose it into 3–6 sequential steps where each step's output feeds the next. For each step state: its single goal, the exact input it receives, and the output format. After defining the chain, execute it one step at a time, pausing to show me the intermediate output before continuing to the next step. Task: <describe your task>
Replace the <…> placeholders, paste it into your agent, and it'll scaffold the workflow with you.