How to Choose Between an AI Agent and a Fixed Workflow
Same LLM, very different control
Two ways to build an LLM feature that does more than answer questions. An agent lets the model decide, at runtime, which steps to take and in what order. A fixed workflow is a sequence of steps you coded, with the LLM filling specific slots — classify this message, extract these fields, draft this reply. The AI agent vs workflow choice is really "who decides the control flow."
When the workflow wins
If the path is known — most business processes are — code it. A returns flow is: look up the order, check eligibility, create the return, confirm. You don't need a model to decide to do those in that order; you need it to handle the language at each step. A fixed workflow is:
- Predictable. It does the same thing every time, and you can test each step.
- Cheaper. No model calls spent on planning; the LLM only runs where it adds value.
- Easier to make safe. Each step's inputs and outputs are constrained by code, not by the model's judgement.
When the agent earns its place
Give the model control of the flow when the path genuinely varies per case and you can't enumerate it: an open-ended support conversation where the customer might ask for three unrelated things, a research task, a troubleshooting dialogue that branches on what the user says. On our support-agent engagement the agent decides whether to call a tool and which — because a real conversation doesn't follow one script — but each tool's business rules still live in code, not the prompt.
The hybrid most systems land at
A workflow with agent-like sub-steps. The overall process is coded; within a step, the model has bounded latitude — "gather whatever you need from these three tools to answer this." You get the predictability of the workflow and the flexibility of the agent where it matters.
A good rule of thumb: if you can draw the flowchart, code the flowchart. If the flowchart has a box that says "figure out what to do next based on the conversation," that box is where the agent lives, and everything around it stays deterministic.
The cost and debugging difference
An agent that plans its own steps is harder to debug (why did it do that?) and harder to cost (how many calls will this take?). A workflow's execution trace is the code. If you're choosing an agent, budget for a cap on steps and richer tracing.
A worked comparison
A returns request. The path is fixed: identify the order, check eligibility against policy and the return window, create the return, confirm. Code that. The LLM's job is to understand "I want to send back the blue one, it's too small" and to phrase the confirmation — not to decide the order of operations.
An open troubleshooting conversation. "My device won't connect, I've tried restarting it, and now the app is showing an error." Where this goes depends entirely on the answers, and you can't enumerate the branches. Give the model latitude to ask, look things up, and decide the next step.
The projects in our portfolio are mostly the first shape — coded workflows with the LLM handling language at each step — with agent latitude reserved for the genuinely open-ended parts, like a support conversation that can go anywhere.
Where this stops being right
- A genuinely open-ended task — forcing it into a rigid workflow means constant "the flow didn't anticipate this" gaps.
- A very simple single-step task — neither framing matters; it's one model call.
- A team without agent debugging experience should start with the workflow and add agent latitude where the workflow visibly can't cope.
FAQ
Default to an agent or a workflow? A workflow. Most processes have a known path — code it, and use the LLM for the language, not the control flow.
When is an agent actually necessary? When the sequence of steps genuinely varies per case and can't be enumerated up front — open-ended conversations, research, branching troubleshooting.
Can we mix them? Yes, and most production systems do — a coded workflow with bounded agent latitude inside individual steps. The overall process is deterministic and testable; within a step, the model has room to gather what it needs from a few tools to complete that step.
ISTRALLEN builds coded workflows with agent latitude only where the path genuinely varies — see what we do.