Sign in
All library
Library· Architecture

Agents vs. workflows

When a predefined workflow beats a dynamic agent — with the patterns from Anthropic's canonical guide.

#architecture#patterns
5 min read

Anthropic's Building effective agents draws a sharp line:

  • Workflows — LLMs and tools are orchestrated through predefined code paths.
  • Agents — LLMs dynamically direct their own processes and tool use.

Prefer workflows when

  • The task decomposes into known steps (extract → classify → route).
  • Latency and cost predictability matter.
  • Failures need to be traced to a specific node.

Prefer agents when

  • The path is unknown at design time (open-ended research, triage across novel data).
  • The model can reasonably recover from its own mistakes.
  • You can afford variable latency and token spend.

Common patterns

Prompt chaining, routing, parallelization, orchestrator-workers, and evaluator-optimizer loops are all documented with code in Anthropic's agents cookbook. Start there before reaching for a framework.