AssayAssay
01 / 08

Lesson 01 · Foundations · 12 min

Workflows and agents

Anthropic's guide draws one line through the whole space of agentic systems, and everything else follows from which side of it you are on.

Workflow or agentworkflow · code decides the routestepstepsteppredictable · cheap to reason about · cannot take a path you did not drawagent · the model decidesmodelchooses nextopen-ended · steps unknown in advance · needs a budget and guardrailsif you can draw the flowchart, build the workflow
The one distinction the taxonomy rests on. In a workflow, code decides the route and the model thinks inside each step. In an agent, the model decides the route.
WorkflowLLMs and tools orchestrated through code paths you defined in advance. The model does the thinking inside each step; your code decides what the steps are.
AgentThe LLM directs its own process — which tools to call, in what order, when to stop — based on what it observes. The route is not known ahead of time.

Workflows are predictable and cheap to reason about. Agents handle problems where the number of steps cannot be known until you are in them. Most production systems that call themselves agents are workflows, and are better for it.

Before either, there is the augmented LLM: one model with retrieval, tools and memory attached. The guide's central advice is blunt — for many applications, optimising a single call with retrieval and in-context examples is enough, and every pattern after that trades latency and cost for capability. Adopt one only when the simpler thing demonstrably fails.

The lab makes that demonstrable. It runs the same task through a single call and through whichever patterns you select, and puts calls, tokens and wall-clock in a table. The single call is the baseline; every other column has to earn its cost against it.

Run the single call on the compound message — three questions in one — and read what it does. On the model this course was built against, it answered all three and also invented a customer-service phone number. That is the baseline the patterns are competing with: fast, cheap, and confidently wrong in one detail.

Checkpoint

Find one thing the single call gets wrong on the compound task.

“Where is my order 41902? It was due on Tuesday.”

Patterns to compare

Run the single call on each of the three tasks and read the outputs closely. Note what it gets wrong — those are the failures the patterns exist to fix.

Pick two or more patterns and press Run. They run in turn, and the table fills in as each one finishes.