Workflow Patterns
Most production agent systems are assembled from a small set of patterns. Anthropic describes them as building blocks rather than rules. Each one trades something for something else, and recognizing the trade lets you pick the right one without trying every option.
The five patterns
| Pattern | Shape | Use it when | Trade-off |
|---|---|---|---|
| Prompt chaining | Sequential steps, with checks between them | A task splits cleanly into fixed subtasks | Higher latency for higher accuracy |
| Routing | Classify the input, then send it to a specialized path | Distinct categories need separate prompts or tools | Classification errors send work down the wrong path |
| Parallelization | Run subtasks at once, or run the same task several times | Subtasks are independent, or you want several opinions | More total cost, and results must be merged |
| Orchestrator-workers | A central model plans subtasks and delegates them | You cannot predict the subtasks in advance | Flexible, but harder to test and predict |
| Evaluator-optimizer | One call generates, another critiques, and the loop repeats | Clear criteria exist and feedback measurably helps | Costs extra rounds, and needs good criteria |
Routing has a useful cost detail. Anthropic's example sends easy questions to a smaller, cheaper model such as Claude Haiku and hard questions to a more capable one such as Claude Sonnet. In your own systems, use claude-haiku-5-5 and claude-sonnet-5-5, the approved models for this course.
Practice
- Take a task from lesson 0002 that you classified as a workflow. Name the pattern that fits and write its trade-off in one sentence.
- Sketch the pattern as boxes and arrows on paper. Mark where a check or gate belongs.
- Identify one place in the sketch where a cheaper model could handle the step. Note the eval from lesson 0006 that would confirm the cheaper model is good enough.
Retrieval check
A drafted document must be translated next, with a quality check between the two steps. Which pattern fits?
Correct. The steps are fixed and ordered, and a programmatic gate checks the intermediate output before the next step runs.
Not quite. The steps run in a fixed order with a check between them, which is the defining shape of prompt chaining with a gate.
A coding task needs an unknown number of file edits, and the subtasks depend on what the code contains. Which pattern fits?
Correct. The orchestrator decides the subtasks from the input, which suits work where the steps cannot be listed in advance.
Not quite. Here the subtasks are not known in advance, so a fixed split or single route will not work. An orchestrator plans the subtasks from the input.