Topic 2
Five workflow patterns
Before reaching for an agent, it's worth knowing how much fixed workflows can do. Anthropic's "Building effective agents" (2024) describes five patterns.
Predict first
Scroll sideways to see the whole diagram
Prompt chaining: a fixed sequence of calls, each working on the last one's output. Code can check the output between steps.
Text version
- Prompt chaining: a fixed sequence of calls, each working on the last one's output. Code can check the output between steps.
- Routing: classify first, then send the input down a path built for its kind. Module 05's query routing is one example.
- Parallelisation: split a task into independent parts run at once (sectioning), or run the same task several times and combine the answers (voting).
- Orchestrator–workers: a model decides the subtasks at run time, so it's closer to an agent, but the structure around it is fixed.
- Evaluator–optimiser: generate, critique, revise. Anthropic notes it works when there are clear evaluation criteria and iteration measurably helps.
- Prompt chaining decomposes a task into a sequence of steps, each call processing the previous one's output. Code can check results between steps.
- Routing classifies an input and sends it to a specialised follow-up.
- Parallelisation runs calls at the same time and combines their outputs in code: sectioning splits a task into independent parts; voting runs the same task several times for diverse outputs.
- Orchestrator–workers: a central model breaks the task down at run time, delegates parts to worker calls, and combines the results.
- Evaluator–optimiser: one call generates a response while another evaluates it and gives feedback, in a loop.
The last two already hand the model some control: the orchestrator decides the subtasks, and the evaluator decides when to stop revising. That's where workflows shade into agents, and where the harness needs limits (how many workers, how many revisions).
Anthropic's general advice comes first in the post: find the simplest solution possible, and only increase complexity when it's needed.
Quick check