Anthropic's agent architectures — workflows & the loop
In Building Effective Agents, Anthropic draws one crucial line: workflows orchestrate LLMs and tools along predefined code paths, while agents let the LLM dynamically direct its own process in a loop. Both are built from one primitive — the augmented LLM — and the whole art is choosing the simplest structure that works.
workflows— code defines the path —predictablevsagents— the model decides —flexible
The headline advice. Don't build an agent when a single well-crafted prompt or a simple workflow will do. Add autonomy (and its cost, latency and unpredictability) only when the task genuinely needs it.
Building block The augmented LLM
Everything is composed from an augmented LLM — a model enhanced with three capabilities it can use itself:
🔎 Retrieval
Pull in relevant external knowledge on demand (RAG) to ground its answers.
🛠️ Tools
Call functions/APIs to act on the world and get real results back.
🧠 Memory
Retain context across steps and turns so it can build on prior work.
Workflows and agents differ only in how these augmented calls are arranged — by your code, or by the model.
Predefined paths Workflow patterns
Five composable patterns cover most workflow needs — the code, not the model, decides the route:
① Prompt chaining sequential steps
Shape Decompose a task into a fixed sequence of LLM calls, each acting on the previous output — with optional programmatic gates to check progress between steps.
Use when The task cleanly splits into predictable subtasks (e.g. outline → draft → polish); trading latency for accuracy.
② Routing classify, then specialize
Shape Classify the input and send it to a specialized prompt or tool tuned for that category.
Use when Inputs fall into distinct kinds that are each handled better separately (e.g. refund vs. technical vs. sales).
③ Parallelization sectioning & voting
Shape Run LLM calls in parallel — either sectioning (split into independent subtasks) or voting (run the same task several times for diverse takes / consensus).
Use when Subtasks are independent (speed), or multiple attempts improve confidence (e.g. guardrail checks, majority vote).
④ Orchestrator–workers dynamic delegation
Shape A central orchestrator LLM breaks a task into subtasks at runtime, delegates them to worker LLMs, and synthesizes the results.
Use when You can't predict the subtasks up front (e.g. multi-file code changes, research over many sources).
Shape One LLM generates, another evaluates against criteria and gives feedback; loop until it passes.
Use when You have clear evaluation criteria and iterative refinement measurably helps (e.g. translation, literary polish).
All runnable here. The experiments folder has working scaffolds for these (sequential, parallel, loop, review & critique, iterative refinement) on the LangChain/LangGraph stack.
The model decides The agent loop
An agent drops the predefined path. Given a task, the LLM plans, calls a tool, observes the result, and loops — repeating until it decides it's done (or hits a stopping condition / human checkpoint). Its trajectory isn't fixed in advance.
the loop, conceptually
# An agent is a loop: reason → act (tool) → observe → repeat, until done.
messages = [user_task]
while True:
reply = llm(messages, tools=TOOLS) # reason / plan
if reply.tool_calls:
results = run_tools(reply.tool_calls) # act
messages += [reply, results] # observe, then loop
else:
return reply # no tool call → done
Use agents for open-ended tasks where the number of steps can't be predicted and you can't (or don't want to) hard-code the path — with guardrails: tool-call limits, stopping conditions, and human checkpoints for high-stakes actions.
Choosing — start simple
If the task…
Reach for…
Fits one well-crafted prompt
Just the augmented LLM — no orchestration
Splits into fixed, ordered steps
Prompt chaining
Falls into distinct categories
Routing
Has independent subtasks / needs consensus
Parallelization
Has unpredictable subtasks decided at runtime
Orchestrator–workers
Needs iterative refinement against criteria
Evaluator–optimizer
Is open-ended with an unknown number of steps
An agent (the loop)
Rule of thumb. Increase autonomy only as the task demands it. More autonomy means more capability but also more latency, cost and unpredictability — so climb this ladder one rung at a time, and measure.
Cheat sheet
Question
Short answer
Workflow vs agent?
Workflow = code defines the path; agent = the LLM decides at runtime.