wiki / concepts / agents-vs-workflows

Agents vs Workflows

high confidence updated 2026-08-30 agents · patterns · llm-fundamentals

Agents vs Workflows

Anthropic’s Building Effective Agents (Dec 2024) draws the fundamental architectural line: workflows use “predefined code paths” while agents “dynamically direct their own processes.” The difference is the degree of autonomy — and the operative test is who decides when to stop: in a workflow the developer’s code terminates the run; in an agent the LLM itself stops when it judges the task complete.^[raw/aihero/what-is-an-agent.md]

The Autonomy Gradient

flowchart LR
    W["Workflow\npredefined code paths\ncode decides termination"] -->|"more autonomy"| A["Agent\nLLM picks tools per step\nLLM decides termination"]
  • Workflows: predetermined steps written in code; better results than agents whenever the task is clearly specified; unfairly maligned for being less exciting.
  • Agents: the LLM improvises through unclear steps, “making it up as it goes” — more powerful, less predictable. Best when the path to completion cannot be specified in advance.

Anthropic’s Workflow Patterns

  1. Prompt chaining — each LLM call processes the previous one’s output.
  2. Routing — an LLM classifies input and directs it to a specialized followup task.
  3. Parallelization — LLM calls run in parallel (e.g. split text, summarize parts, summarize summaries).
  4. Orchestrator-workers — a central LLM breaks tasks down and delegates to worker LLMs (see multi agent orchestration).
  5. Evaluator-optimizer — one LLM generates while another evaluates in a loop (see generator evaluator loop).

Only one pattern is truly agentic: agents “plan and operate independently,” “gain ground truth from the environment at each step” (tool results, code execution), and terminate on completion or a stopping condition (e.g. max iterations). The compressed definition: agents are just LLMs using tools based on environmental feedback in a loop — which is precisely the tool calling loop.^[raw/aihero/building-effective-agents.md]

Anti-Pattern: Frameworks First

Anthropic repeatedly warns against agent frameworks as a first resort (LangGraph, Bedrock Agents, etc.): they “create extra layers of abstraction that can obscure the underlying prompts and responses” and tempt complexity where a simpler setup suffices. Use LLM APIs directly until you understand the code you’d be abstracting.^[raw/aihero/building-effective-agents.md] (Pocock’s carve-out: a compatibility library like the AI SDK is not a framework — see model provider abstraction.)

Rule of Thumb

Workflows when the path is known and repeatable; agents when it is not. If you can draw the flowchart, build the workflow - the flowchart IS the reliability.

Failure Modes

SymptomRoot causeFix
Workflow built where judgment neededPath assumed known when it is notIf branching is data-dependent, use an agent
Agent used for a known pipelineAutonomy added without needDraw the flowchart first; if complete, it is a workflow

tool calling loop, generator evaluator loop, multi agent orchestration, agent harness engineering, llm message protocol.

Evidence — verified primary sources
raw/aihero/building-effective-agents.md internal workspace doc
raw/aihero/what-is-an-agent.md internal workspace doc
raw/aihero/what-is-an-ai-engineer.md internal workspace doc