Articles · Artificial intelligence · · 7 min read
When a Deterministic Workflow Beats an LLM Agent
Agent autonomy is a control-flow decision, not a capability one. How to tell which steps deserve a planner and which should stay a hard-coded edge.
By Matthieu de La Mettrie · Founder, Skopura
The agent-or-workflow argument usually gets framed as a maturity ladder: you start with chains, you graduate to agents. That framing is wrong and it costs you in production. The two are not stages. They are different answers to one narrow question — who decides what happens next at runtime — and you answer that question separately for every step in the system.
If you have already decided to build, this is the first design decision that is expensive to reverse. Everything downstream inherits it: how you test, how you roll back, how you explain an outcome to someone who is unhappy about it.
What is actually being decided?
In a workflow, the edges between steps are written by you, in code, before the request arrives. Content can influence which edge is taken — a classifier, a switch, a predicate — but the set of edges is fixed and enumerable. In an agent loop, the model chooses the next action from a tool set, and the edge set is effectively the product of the tools and the model’s judgement at that moment.
So the question is not “is this task hard enough for an agent”. It is “do I know the shape of the path in advance”. Hard tasks with known shapes belong in workflows. Trivial tasks with unknowable shapes may genuinely need a planner.
Where does an agent actually earn its keep?
An agent earns its keep where the branching factor is unknown at design time and the cost of a wrong branch is low. Research-style tasks over a heterogeneous corpus qualify: you cannot enumerate in advance how many hops a question needs, and a wasted hop costs tokens and nothing else. Triage over messy inbound text qualifies if the downstream action is itself constrained.
The tell is that you keep adding branches to a workflow and the branches keep coming from the data rather than from the schema. If your switch statement has grown by one arm every time a new document format shows up, you are hand-rolling a planner badly, and a model will do it better.
The opposite tell is just as clear. If you can draw the whole process on a whiteboard and nobody in the room argues about the order of the boxes, an agent adds nothing but variance. You are paying planner tokens, latency, and an entire class of failure mode in exchange for rediscovering a path you already know.
What does the deterministic version buy you?
Mostly it buys you the ability to reason about the system at all.
| Deterministic workflow | Agent loop | |
|---|---|---|
| Who picks the next step | You, at design time | The model, at runtime |
| Unit you can test | A step, with fixtures | A trajectory, with judgement |
| Typical failure | Unhandled case falls through | Plausible path to a wrong action |
| Changing behaviour | Edit an edge, review a diff | Edit a prompt, re-run the suite |
| Explaining an outcome | Read the path taken | Reconstruct from traces |
| Where effort accumulates | Enumerating cases up front | Constraining tools and evaluating |
Resumability is the underrated one. A workflow with explicit steps can checkpoint between them, so a transient tool failure resumes rather than replans. An agent loop that fails mid-trajectory usually restarts, and restarting a non-deterministic process does not reproduce the prior state — it produces a different one that also has to be correct.
Can the two be mixed?
Yes, and that is usually the right answer. The pattern that holds up is a deterministic spine with autonomy confined to named nodes.
Put the planner inside a node that has a declared input contract, a declared output schema, a bounded tool set, and a step budget. The node is free internally. Outside it, the graph is fixed. Validation and commit live on the spine, never inside the agent’s tool set — the model proposes, the spine disposes.
const graph = workflow()
.step('parse', parseRequest)
.branch('route', classify, {
known: 'fixedPath',
novel: 'investigate',
})
.step('fixedPath', retrieveThenDraft)
.agentNode('investigate', {
tools: [searchCorpus, readDocument, summarise], // read-only
maxSteps: 6,
output: FindingSchema,
})
.step('validate', assertSchemaAndPolicy)
.step('commit', writeOnce); // the only tool that mutatesThe inverse also works: a tool exposed to an agent can itself be a deterministic workflow. “Issue a refund” as a single tool, implemented as a five-step pipeline with its own checks, is far safer than exposing the five steps and trusting the planner to order them.
How do you decide for a specific step?
Run the step through the questions below rather than the system as a whole. Most systems end up mixed, and the mix is the design.
Hard-code the whole path; an agent adds variance and nothing else
What breaks when you get it wrong in each direction?
Over-agenting a fixed process fails quietly. The system works in demos because the model happens to pick the sensible order. Then an edge case arrives, the planner takes a defensible-looking detour, and the output is wrong in a way that reads as reasonable. Nobody catches it because there is no canonical path to compare against. You end up writing guardrails that reconstruct the workflow you refused to write, except now they live in a prompt.
Under-agenting an open space fails loudly, which is at least honest. The branch count explodes, the conditional logic becomes unreadable, and a human starts doing the routing manually before handing work back to the pipeline. That is a clear signal, and the fix is scoped: replace the branch thicket with a planner over the same tools, keep the leaves intact.
How does testing differ, and why does that drive the choice?
A workflow step is testable with fixtures. Input in, output out, assert. Coverage is a question you can answer by counting branches. An agent node is testable only at the trajectory level, and the oracle is softer — you are asking whether the path was reasonable and the result acceptable, not whether it matched a golden value.
That asymmetry should feed back into the design. Every node you make autonomous is a node whose correctness you will argue about rather than assert. Keep the count small and keep the boundaries sharp enough that a failing trajectory points at one node.
What should be written down before any of this is built?
Three things, and they are short.
First, the irreversible actions. List every tool that writes, pays, sends or deletes. That list defines the deterministic tail of the system, and nothing on it belongs in a planner’s tool set without a gate.
Second, the known paths. If a request type has a canonical handling order, write it as an edge, not as a prompt instruction. Prompt instructions are suggestions; edges are not.
Third, the budget per autonomous node — steps, tools, and the output schema it must land in. A planner without a step budget is a planner that will eventually loop, and a planner without an output schema hands you prose where you needed a record.
Get those three on a page and the workflow-versus-agent question mostly answers itself. What is left over — the part you genuinely cannot enumerate — is the part that deserves a model in the control loop. Everything else is a graph you already know how to draw.
agentic-ai · system-design · orchestration · llm-architecture
Share on LinkedIn ↗Work with Skopura
Facing this bottleneck in your own estate?
Skopura builds production-grade lakehouse pipelines, evaluation harnesses, and provides fractional data leadership. Thirty-minute call, no deck.