Workflow or agent? 5 patterns from Anthropic for picking the right architecture
TL;DR
Workflows: LLMs and tools follow predefined code paths. Agents: the LLM decides its own next step. Start with the simplest thing that works; add complexity only when it measurably helps. Five common workflow patterns solve most problems before you need an agent.
5 workflow patterns
| Pattern | How | Example |
|---|---|---|
| Prompt chaining | Break work into sequential steps with checks in between | Outline → check → write |
| Routing | Classify the input, send it to a specialized branch | Tickets: technical / billing / feedback |
| Parallelization | Run parts or attempts in parallel, then aggregate/vote | Review code on 3 criteria at once |
| Orchestrator-workers | One LLM dynamically delegates to workers | Edits across files not known in advance |
| Evaluator-optimizer | One LLM generates, another critiques, loop | Translation, rewriting to meet criteria |
When do you need an agent?
- Open-ended problems with an unpredictable number of steps (debugging, research, coding).
- Environments with clear feedback (tests pass/fail, tool results) so the agent can self-check.
- You accept higher cost and have guardrails: iteration caps, sandboxes, human checkpoints.
Original article: Building effective agents — Anthropic Engineering