Agents · comparative
Workflow vs Agent
Both use LLMs. The difference is who owns the control flow.
Distinguishes Workflow and Agent Loop.
Both a workflow and an agent are systems built around LLM (large language model) calls, and from outside they can look identical: text goes in, actions happen, an answer comes out. The difference is who owns the control flow, the order in which the steps run.
An agent is a tool-loop, and the whole of it is five lines:
messages = [system, user]
loop:
reply = model(messages, tools) # model may request tools
if no tool_calls: return reply
results = run(reply.tool_calls)
messages += [reply, results] # feed the results back
The stopping condition belongs to the model, not to your code. The model decides at runtime whether it needs a tool, which one, with what arguments, and when it is done, so the step count is not known before the run. Whether the step count is fixed in advance is what separates a workflow from an agent.
In a workflow you own the flow: the steps are fixed in code at design time and the model runs inside them, one call to classify, one to extract, each on a path you drew. Calling a model once, taking a structured answer, then letting your code decide what happens next is a workflow with one model step, because the step count is still fixed. A workflow full of model calls is one for the same reason. In an agent the model owns the flow, and the loop stays open until it decides it is done.
Who owns the flow is one axis with three points. Pure rule-based automation, no model at all, sits at one end and is often the right choice. A workflow adds model calls inside steps you fixed. An agent hands the order itself to the model. Autonomy rises across the three, and so does the cost of a step you cannot test before it runs.
Default to the lowest autonomy that works. Every step where the model owns the flow is a decision you cannot assert on before it runs; every step fixed in code can be tested, cached, and costed in advance. Autonomy earns its price only where the steps cannot be known before the model runs: open-ended research, a build whose plan depends on the code, a case that branches on the customer’s reply. Build up the autonomy ladder, five rungs: manual, suggested, drafted-then-approved, supervised, autonomous. Most steps belong far below the top.
Starting with an agent means adding turn limits, retries, and permission checks after the fact. A fixed workflow has a known order from the start when the task needs no runtime planning.
Handing the flow to the model does not hand over the design. The model owns when the loop stops; you own what it can reach and how far it can go, the tools it can call, the checks between turns, the caps that end it. Designing an agent is designing those bounds, not its steps.