2.1 Workflows vs Agents

Key Takeaways

  • Workflows use predefined code paths; agents dynamically direct their own process.
  • Prompt chaining works when the step order is known.
  • Routing works when inputs belong to known categories.
  • Orchestrator-worker fits tasks where subtasks cannot be predicted ahead of time.
Last updated: June 2026

Pattern Selection

A workflow orchestrates model calls and tools through a predefined path. An agent lets the model dynamically decide how to proceed, often with tool calls and looped observations. Agents are more flexible, but they cost more to evaluate and control.

Common Patterns

PatternUse when
Single callTask is direct and bounded
RAG callAnswer needs current context
Prompt chainSteps are known in order
RoutingInputs fall into categories
ParallelizationSubtasks are independent
Orchestrator-workerSubtasks are dynamic
Evaluator-optimizerQuality can be judged clearly

Exam Decision Rule

Choose autonomy only when it creates measurable value. If a classification step can route requests reliably, do not build a general agent. If a known sequence can solve the task, do not ask an agent to discover that sequence every time.

Failure Modes

Agents can loop, call the wrong tool, overuse context, or make coordination mistakes between subagents. Workflows can be too rigid and fail when inputs vary. Good architects know both failure modes and select the least complex design that still handles the real input distribution.

Test Your Knowledge

A support system classifies requests as billing, technical, or account access, then sends each to a specialized prompt. Which pattern is this?

A
B
C
D