CClaude Cert Prep
ExplainerCCAR-P · P18 min read

Agents vs Workflows in Claude, Explained

The difference is who decides the next step — your code or the model — and the rule is to pick the least autonomy that solves the problem.

The short answer

A workflow has predetermined control flow: your code decides the sequence of steps and Claude fills in each one. An agent hands that control to the model — Claude chooses the next step and which tool to call at runtime, in a loop, until it decides it's done. Neither is better; the rule is to use the least autonomy that reliably solves your problem.

"Agent" has become a marketing word for anything that calls an LLM, which makes it useless for engineering decisions. The distinction that actually matters is about control: in a workflow, your code owns the control flow and the model just fills in the blanks at each fixed step. In an agent, the model owns the control flow — it decides what to do next and which tool to reach for, over and over, until it judges the task complete.

That difference drives everything: cost, latency, reliability, debuggability, and how much can go wrong. This guide defines both precisely, walks the agentic loop, gives you a short test for when the extra autonomy is justified, explains why multiple agents are expensive to coordinate and why subagents start blind, and ends with a decision table you can apply to a real feature.

Definitions: who owns the control flow

A workflow is a system where the steps are orchestrated by your code through predefined paths. You wrote the sequence — extract, then classify, then draft, then send — and Claude executes each step, but it never gets to decide the order or invent a new step. The path is knowable before you run it. A prompt chain, a router that picks one of three fixed branches, and a parallelized fan-out are all workflows.

An agent is a system where the model directs its own actions. You hand Claude a goal and a set of tools, and at each turn it decides — based on what it has seen so far — which tool to call next, or whether it is finished. The control flow is discovered at runtime and can differ every run. The trade is real power for real unpredictability.

WorkflowAgent
Who picks the next stepYour codeThe model, at runtime
Control flowPredetermined, knowable in advanceDynamic, discovered per run
Path variabilitySame structure every runCan differ each run
DebuggabilityHigh — fixed graphLower — must trace decisions
Best whenSteps are known and stableSteps can't be predicted upfront

The agentic loop: what 'the model decides' looks like

An agent is fundamentally a loop. The model receives the goal and current context, chooses an action (usually a tool call), the environment runs that tool and returns a result, and that result is fed back into the model's context. Then it decides again. The loop continues until the model emits a stop signal ("task complete") or hits a guardrail you imposed — a step budget, a token cap, or a timeout.

code
while not done:
    action = model.decide(goal, context)   # model chooses the next tool
    if action == STOP:
        done = True
    else:
        result = run_tool(action)           # environment acts
        context = context + result          # feedback loops back in
    if steps > MAX_STEPS: break             # your guardrail, not the model's

Two properties fall out of this shape. First, the agent can recover from surprises — if a tool returns an error or unexpected data, it can adapt on the next turn, which a rigid workflow cannot. Second, nothing bounds it except the guardrails you add. Without a step budget it can loop, repeat itself, or wander. The autonomy that makes agents powerful is the same autonomy that makes them need containment.

When is an agent actually justified? A short test

Autonomy is a cost, not a feature. Every degree of freedom you hand the model is latency you can't predict, tokens you can't bound tightly, and failure modes you can't enumerate in advance. So the default should be the least autonomy that solves the problem — reach for an agent only when a workflow genuinely cannot do the job. Run the candidate task through these questions:

  • Unpredictable path: Is the sequence of steps impossible to know in advance because it depends on what earlier steps reveal? (If you can hardcode the path, do — it's a workflow.)
  • Open-ended decisions: Does the task genuinely require judgment at each step — choosing among many tools, deciding when it's done — rather than following fixed rules?
  • Value justifies cost: Is the outcome worth the extra latency, token spend, and unpredictability that autonomy brings?
  • Containable blast radius: Can you make the model's actions safe — reversible, sandboxed, or gated — so an unexpected decision can't cause real harm?

If the honest answer to the first three isn't clearly yes, a workflow will be cheaper, faster, and easier to debug. If you can't answer yes to the fourth, you aren't ready to give the model that much freedom yet — add gates first. Many production "agents" are really workflows with one small agentic step tucked inside, and that is usually the right design.

Single agent vs multi-agent: coordination is not free

Once one agent works, it is tempting to spin up several specialists — a researcher, a writer, a critic — coordinated by an orchestrator. Sometimes that genuinely helps: truly parallel subtasks, or work that needs isolated context windows so one job's clutter doesn't pollute another's. But every added agent multiplies cost and introduces coordination overhead: the orchestrator has to decompose the task, route it, and reconcile results, and each handoff is a place where information is lost or garbled.

Multi-agent systems also burn far more tokens than a single agent — every agent re-reads context and produces intermediate output — and they are markedly harder to debug because a failure can hide in any agent or in the seams between them. Prefer a single, well-equipped agent until you have concrete evidence that parallelism or context isolation is worth the coordination tax.

FactorSingle agentMulti-agent
Token / dollar costLowerMuch higher (context re-read per agent)
Coordination overheadNoneDecompose, route, reconcile
DebuggabilityOne traceFailures hide in the seams
Justified whenMost tasksReal parallelism or context isolation

Subagents start blind: context does not inherit

The single most common multi-agent bug: assuming a subagent can see what the coordinator saw. It cannot. Each subagent runs with its own fresh context window. It does not inherit the coordinator's conversation, the user's original phrasing, the earlier tool results, or the reasoning that led to its assignment — unless you explicitly pass those into its prompt. A subagent knows only what you hand it.

This has direct design consequences. The coordinator's job is largely to write good briefs: each subagent's instructions must be self-contained, carrying every fact, constraint, and piece of prior context the subtask needs. And because the subagent's internal reasoning and tool chatter stay in its own window, what comes back to the coordinator is only its final report — so that report must contain everything the coordinator needs, including file paths and concrete findings, not a vague summary.

Human-in-the-loop gates and escalating on policy

The safe way to give an agent real-world power is to gate the irreversible parts. A human-in-the-loop (HITL) gate pauses the loop before a consequential action — sending money, deleting data, emailing a customer, merging code — and requires explicit approval before it proceeds. Reversible actions can run freely; irreversible ones stop for a human. This lets you grant autonomy where it's cheap to be wrong and withhold it where it's expensive.

Crucially, decide what to gate on policy, not on the model's confidence. "Escalate when confidence is below 0.8" is fragile: the confidence number isn't calibrated, and the model is least reliable about its own reliability exactly when it's wrong. "Any refund over $100 always needs human approval" is a policy — it triggers on the nature of the action, deterministically, regardless of how sure the model claims to be. Gate on the action's stakes, which you control, not on a self-report you can't trust.

  • Let reversible, low-stakes actions run without a gate.
  • Gate irreversible or high-stakes actions on an explicit policy.
  • Make gates deterministic — same action type, same review every time.
  • Log every gated decision so approvals are auditable after the fact.

A decision table: workflow, single agent, or multi-agent

Put it together as a default ladder. Start at the top and only descend when the task proves the simpler tier can't do the job. Each rung down buys capability at the price of cost, latency, and unpredictability — so earn each step.

If the task is…UseBecause
One well-defined transformationA single promptNo orchestration needed at all
A known, fixed sequence of stepsA workflowYou can hardcode the path; keep it debuggable
A fixed branch on the inputA router workflowDecision is bounded to a few known paths
Path depends on what steps revealA single agentThe model must choose the next step at runtime
Truly parallel or context-isolated subtasksMulti-agentParallelism/isolation outweighs coordination cost
Any irreversible action in the pathAdd a HITL gateGate on policy, not on model confidence

Key takeaways

  • →A workflow's control flow lives in your code; an agent's control flow lives in the model, chosen step by step at runtime.
  • →If you can draw the flowchart before running it, it's a workflow; if the model draws it as it goes, it's an agent.
  • →An agent is a decide-act-feedback loop — always bound it with step budgets, token caps, and timeouts.
  • →Use the least autonomy that solves the problem: an agent is justified only when the path is unpredictable, decisions are open-ended, the value beats the cost, and the blast radius is containable.
  • →Multi-agent systems cost far more and are harder to debug; prefer one well-equipped agent until parallelism or context isolation clearly pays for the coordination tax.
  • →Subagents don't inherit the coordinator's context — each starts with a fresh window, so briefs must be self-contained and reports must carry the concrete findings back.
  • →Gate irreversible actions with human-in-the-loop review, and escalate on policy (the action's stakes) rather than on the model's uncalibrated confidence.

Now practice it

Reading builds recognition; practice builds judgment. Try these on the P1 material.

Frequently asked

What's the simplest way to tell a workflow from an agent?

Ask who decides the next step. If your code determines the sequence and Claude only fills in each step, it's a workflow. If Claude decides what to do next and which tool to use at runtime, in a loop, it's an agent. Workflows have a knowable path; agents discover the path as they run.

Why not just always use an agent — isn't more autonomy better?

No. Autonomy costs latency you can't predict, tokens you can't tightly bound, and failure modes you can't enumerate. The principle is to use the least autonomy that reliably solves the problem. A workflow is cheaper, faster, and far easier to debug whenever the steps are actually knowable in advance.

When does a multi-agent system beat a single agent?

Only when you have genuinely parallel subtasks or need isolated context windows so one job's clutter doesn't pollute another's. Multi-agent designs multiply token cost and add coordination overhead — decomposing, routing, and reconciling results — and hide failures in the seams, so they need concrete justification.

Do subagents remember what the main agent already knows?

No. Each subagent runs in its own fresh context window and inherits none of the coordinator's conversation, tool results, or reasoning unless you explicitly pass them in. Write self-contained briefs, and make each subagent's final report carry the concrete findings the coordinator needs, including file paths.

Should I escalate to a human based on the model's confidence?

No — escalate on policy, not confidence. The model's confidence isn't calibrated and is least trustworthy exactly when it's wrong. Instead, gate on the nature and stakes of the action: define rules like 'any refund over $100 needs approval' that trigger deterministically regardless of how sure the model claims to be.

What guardrails does an agent need?

At minimum a maximum step count, a token budget, and a timeout so the loop can't run away, plus human-in-the-loop gates before any irreversible action. Reversible, low-stakes actions can run freely; high-stakes ones should stop for review, and every gated decision should be logged for auditing.

All explainers

Independent, unofficial study material from Claude Cert Prep. Not affiliated with Anthropic.