---
title: "Agents vs Workflows"
description: "The degree-of-autonomy spectrum from Anthropic's Building Effective Agents: workflows run on developer-defined code paths, agents direct their own process via tools and environment feedback."
section: "concepts"
type: "concept"
created: "2026-08-30"
updated: "2026-08-30"
confidence: "high"
tags: ["agents", "patterns", "llm-fundamentals"]
canonical: "https://pyweb.dev/wiki/agents-vs-workflows"
---
# 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
```mermaid
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](/wiki/multi-agent-orchestration)).
5. **Evaluator-optimizer** — one LLM generates while another evaluates in a loop (see [generator evaluator loop](/wiki/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](/wiki/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](/wiki/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

| Symptom | Root cause | Fix |
|---|---|---|
| Workflow built where judgment needed | Path assumed known when it is not | If branching is data-dependent, use an agent |
| Agent used for a known pipeline | Autonomy added without need | Draw the flowchart first; if complete, it is a workflow |

## Related
[tool calling loop](/wiki/tool-calling-loop), [generator evaluator loop](/wiki/generator-evaluator-loop), [multi agent orchestration](/wiki/multi-agent-orchestration), [agent harness engineering](/wiki/agent-harness-engineering), [llm message protocol](/wiki/llm-message-protocol).

---

## Agent Navigation

cluster: llm-fundamentals (8 pages) | betweenness: 102.9

### References (outbound)
- [Multi-Agent Orchestration](https://pyweb.dev/wiki/multi-agent-orchestration.md)
- [Generator-Evaluator Loop](https://pyweb.dev/wiki/generator-evaluator-loop.md)
- [Tool Calling Loop](https://pyweb.dev/wiki/tool-calling-loop.md)
- [Model Provider Abstraction](https://pyweb.dev/wiki/model-provider-abstraction.md)

### Referenced by (inbound)
- [LLM App Improvement Ladder](https://pyweb.dev/wiki/llm-app-improvement-ladder.md)
- [Multi-Agent Orchestration](https://pyweb.dev/wiki/multi-agent-orchestration.md)

### 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)

### Machine endpoints
- Knowledge graph: https://pyweb.dev/api/graph.json
- Graph analysis: https://pyweb.dev/api/graph-analysis.json
- Context index: https://pyweb.dev/llms.txt
