AI Agents
Agentic Workflows: When Should an LLM Control the Flow?
The same support assistant as a fixed workflow, an agent, and a hybrid of the two, measured on twelve questions: what each control flow got right, what it cost, and why the hybrid never got to use its agent.
On this page · 10 sections
In “Tools, Function Calling, and the Foundation of AI Agents (opens in a new tab)”, several failures came from the same place: the model was choosing the steps. It searched the help center when the answer was in the invoices. It wrote “Let’s check the next oldest invoice” and then stopped. Neither was a tool problem. Both were the model deciding what happens next, and deciding badly.
So why let it decide? For a question like “Until what date can I ask for a refund on INV-1002?”, the steps are always the same: look up the invoice’s refund status, then answer. Code can do that every time.
But some questions don’t have a fixed path. “Something looks off with my October bill. What happened?” might be a duplicate charge, a failed payment, a plan change, or nothing at all. Which records to read next depends on what the first ones show. That is what an agent is for, as “What Is an AI Agent? (opens in a new tab)” defined it: a model that uses each result to decide the next step.
The obvious design is to use both: a fixed workflow for the questions you can predict, and an agent for the ones you can’t. This article measures that design against the two it combines. The result was not the one the design assumed.
Try to Understand It This Way
Picture a support desk with two kinds of staff. Clerks follow written procedures: for a refund question, open the refund screen, read the status, answer. They are fast, consistent, and easy to check. An investigator handles the odd cases: they open whatever records the case needs, follow leads, and decide when they’re done. They are slower and more expensive, and two investigators may work the same case differently.
At the front sits a receptionist. Every request goes to a clerk, or, if it fits no procedure, to the investigator.
The receptionist is the part that is easy to overlook. If they never say “this one isn’t a standard case,” the investigator never gets any work, and every odd case lands on a clerk who follows a procedure that doesn’t fit. The desk then behaves exactly like a desk with no investigator at all.
In software, the clerks are fixed workflows: steps in code, with the model writing the reply. The investigator is an agent loop. The receptionist is a router: one model call that classifies the request.
Who Controls the Flow
Anthropic’s “Building effective agents” lists the common patterns: prompt chaining, routing, parallelization, orchestrator-workers, and evaluator-optimizer, all “workflows,” where “LLMs and tools are orchestrated through predefined code paths,” and agents, where the model directs the process. “LLM Applications vs AI Agents: What’s the Difference? (opens in a new tab)” sorted them by who decides what happens next. This article asks the next question: given a real workload, which decisions should the model make?
Anthropic’s own answer is a trade-off: “Agentic systems often trade latency and cost for better task performance,” and “workflows offer predictability and consistency for well-defined tasks, whereas agents are the better option when flexibility and model-driven decision-making are needed at scale.” That is a claim you can measure on your own system.
The Experiment
The companion demo, 02-agentic-workflows, builds the support assistant three ways. The model, the customer-facing system prompt, the data, and five read-only tools (help-center search, invoices, refund status, payments, and plan history) are identical. W and H add a router call, with its own classification instructions, before the assistant runs; A does not. The control flow is the variable being compared.
system who decides the steps
W workflow a router picks a known intent or "other"; code runs that intent's fixed
tool calls and the model writes the reply; "other" goes to a person
A agent the model gets all five tools and chooses what to call, in what order,
for up to five model calls
H hybrid the same router; known intents take W's fixed path, "other" goes to
A's agent loop
The known intents and their fixed steps:
refund_status get_refund_status()
invoice_lookup get_invoices()
help_center search_help_center(<the customer's question>)
The model is qwen2.5:3b. Article #23 found that llama3.2:3b, in this Ollama setup, sees no tools after the first tool result, which would turn its agent into a one-step agent; the comparison here should measure the control flow, not that template.
Twelve questions: eight known-path questions that fit an intent (“Can I still get a refund for INV-1001?”, “How do I cancel my subscription?”), and four open-ended ones that should go to other. For the open-ended ones, the synthetic account now has card payments and a plan history: October’s invoice had a declined first attempt and was then charged twice on the retry day, and two extra seats were added on November 5.
The questions, the intent a correct router picks for each, the expected answers, the facts each depends on, and the grading rules were frozen before any system code was written. Each question was asked of each system with three seeds: 108 conversations. Three rules decide what counts:
- A wrong route is a routing error, even if the reply after it happens to be acceptable.
- A handoff to a person is its own outcome. It is never scored as right or wrong, and no human answer is simulated.
- A success is a correct answer built on facts the model actually retrieved, as in Article #23. Every reply was read and labeled by hand.
Implementation note: the exact setup
Runtime: Ollama 0.40.16 on an Apple M4 Pro, /api/chat
Model: qwen2.5:3b (357c53fb659c), Q4_K_M; template saved with the run
Router: one model call with a JSON schema (an enum of the four intents)
Settings: default sampling, seed = run number (1-3), at most 5 model calls and
1,000 tokens per call in the agent loop; model unloaded before the
run, loaded with one throwaway request, unloaded after
Runs: 3 systems x 12 questions x 3 seeds = 108 conversations, 183 s
Frozen: data/ hashed at 2026-11-15 10:47:37 UTC, before any system code
Isolation: for every conversation, the runner recorded whether any other model
was loaded in Ollama; none was
Date: 2026-11-15
All three systems call the same tool functions. The workflow’s tool results reach the model in the same format the agent’s do, as an assistant turn that made the calls followed by their results, so its phrasing step differs from the agent’s last step only in who chose the calls. Model calls, input tokens, and latency include the router, the agent loop, and the phrasing step. Latency is wall-clock time for the automated path.
The isolation check matters: in a short trial run, made while another process was using Ollama, the same router call took about five times longer and the same phrasing step nearly three times longer. It is kept in the demo as a record and isn’t part of the results.
What the Numbers Say
W workflow A agent H hybrid
successes, 8 known questions (of 24) 18 10 17
successes, 4 open questions (of 12) 3 2 3
routing errors (of 36) 15 - 15
handoffs to a person 0 - -
model calls per conversation 2.00 1.97 2.00
input tokens, median per conversation 619 1,058 619
seconds, median / slowest 1.15 / 5.7 1.88 / 9.1 1.04 / 5.6
With three seeds per question, a difference of one or two conversations should be treated as noise rather than evidence of a real improvement.
The router never said “this isn’t mine”
In both W and H, all twelve open-ended runs (four questions, three seeds each) were routed to a known intent. “Something looks off with my October bill” and “Why did I pay $15 on November 5?” went to invoice_lookup. “Have you ever refunded me anything?” and “My card was declined in October. Do I still owe you anything?” went to refund_status. So did every run of “How long do I have to request a refund?”, a policy question meant for the help center. Those are each routed system’s 15 routing errors: twelve open-ended runs plus three runs of the policy question.
The consequences follow directly:
- W never handed off. Every question, including the ones it had no workflow for, went down some fixed path.
- H’s agent never ran. H took exactly W’s routes in all 36 conversations, so its results are W’s results. Its one-conversation difference comes from replies that differed despite identical input and seed (33 of 36 pairs were word for word the same).
In this experiment, the router never selected other, so the hybrid’s agent fallback was never exercised. The design assumed a router that recognizes what it can’t handle. This one, with this model and this prompt, answered every request as if it fit.
Lucky routes are still wrong routes
W and H answered three open-ended conversations correctly, and all three were the same question: “Why did I pay $15 on November 5?” The wrong route, invoice_lookup, happened to return the invoice list, where that invoice is described as “Extra seats add-on.” That is luck, not routing.
The same wrong route on the October question shows the cost of luck running out. The invoice list says October’s invoice was paid; it can’t show that the payment went through twice. Every W and H reply said the October bill was paid, and none found the second charge. One:
Based on the invoice information provided, it seems that your October bill was paid
on time with no issues.
A workflow that receives a question it wasn’t built for doesn’t fail loudly. It runs its steps and answers confidently from data that can’t contain the answer.
On the known questions, the fixed path won
The eight known-path questions are the case for workflows, and the numbers back it: 18 successes of 24 for W, 10 for the agent. The agent had the same tools and chose worse:
- For “How do I cancel my subscription?” and “How much does the Pro plan cost?”, it opened the plan history twice each instead of searching the help center. One of those replies told the customer to cancel by contacting support.
- Twice, it called no tool at all: once it asked the customer for an invoice id it could have looked up, and once it said no tool could give it the plan’s price.
- Twice, it announced a next step and stopped, as in Article #23.
The workflow didn’t make those choices because it didn’t make choices: the steps were in code. Its failures on known questions came from elsewhere: three were the misrouted policy question, and the rest were replies that misread a correct tool result, which the agent did too.
It was also cheaper. On the known questions, the median conversation used 622 input tokens with W and 957 with the agent; the median latency was 0.92 seconds against 1.37, and the slowest 2.98 against 4.05. The router itself was a small cost: a median of 129 input tokens and 0.09 seconds.
Tools didn’t make the agent investigate
The open-ended questions are the case for agents, so the agent’s 2 successes of 12 deserve a closer look.
On the October question, the one with the duplicate charge, the agent never called get_payments in any of its three runs, the only tool that could show it. Twice it read the invoices (once also checking refund status), and one of those runs ended with “Next, let’s check your payment history” and stopped. The third run called nothing and asked the customer for invoice ids.
On “Do I still owe you anything?”, it did call get_payments, in all three runs. The payment record that settles the question, October’s invoice paid on the retry day, was in front of it each time. Each reply still invented an answer:
The total amount owed for this invoice is $75 (25 for the initial charge and 3 failed
charges).
Another said $25 was still owed; the third described the declined attempt as refunded. No system answered either of these two questions correctly. The agent’s two open-ended successes were both “Have you ever refunded me anything?”, answered by listing each invoice’s refund status. W and H, routed to refund_status for that question, got the same data and misstated which invoices could still be refunded.
An agent has the freedom to investigate. Whether it uses that freedom well is a property of the model, and this one, at 3B parameters, mostly didn’t.
Want to go deeper? Two answers that were right for the wrong evidence
Two of the agent’s replies to “How much does the Pro plan cost?” gave the right price, $25 per month, from the plan history (“Started the Pro plan ($25 per month)”) instead of the help center. The facts frozen for that question accept only the help-center text, so these replies count as correct but not as successes. The frozen facts weren’t changed after the fact; the gap is noted in the demo’s labels.
It’s a small example of a real issue: when an answer can be supported by more than one source, an evaluation that names one source will undercount. Decide, before running, which sources are acceptable evidence.
When Should the LLM Control the Flow?
The experiment doesn’t settle this in general. One small model, one router, twelve questions. But it does show what to check, in order.
1. Can you write the steps down? If a request always needs the same lookups, a workflow did better here on answer success, input tokens, and latency. It also kept tool selection out of the model’s hands, so there was no way to wander. That matches Anthropic’s “predictability and consistency for well-defined tasks,” and OpenAI’s agent guide puts it more bluntly: “Before committing to building an agent, validate that your use case can meet these criteria clearly. Otherwise, a deterministic solution may suffice.”
2. Does the next step depend on what the last one found? That is the case for an agent. But the agent here had the right tools and mostly didn’t use them well. Before relying on a model to investigate, test it on investigations, with questions whose answers you know, and check whether it looks in the right place, not only whether it answers.
3. Can the boundary be recognized? A hybrid is only as good as its router’s “I don’t know.” A router should not only recognize known intents; it also needs a reliable way to recognize when none of them fits. Here, that was never said. If you build one, test the router on its own, with requests that should go to other, and measure that rate before measuring anything downstream. This experiment didn’t test ways to make the boundary easier to recognize, such as examples of other in the router’s prompt, or a check in code that sends a request onward when the workflow’s results can’t answer it; those are reasonable next experiments, not results.
4. What does a wrong step cost? Here, every tool only read. When a step can refund, email, or delete, a wrong route or a wandering agent costs more, and the case for fixed paths, with approval for actions (see “Function Calling and Tool Use in LLMs (opens in a new tab)”), gets stronger.
5. What are the latency and cost budgets? The agent’s slowest conversation took 9.1 seconds, the workflow’s 5.7. Workflows have a predictable number of model calls; agents have a cap.
What Breaks
A router that never declines. The failure measured here: every request is forced into a known path. It is silent, because each path still produces a fluent answer.
Answers from data that can’t contain them. A workflow run on the wrong intent answers from whatever its steps return. “Your bill looks fine,” from an invoice list that can’t show a duplicate charge, is worse than a handoff.
An agent with access but no investigation. Having get_payments in the toolset didn’t mean the agent called it when it mattered, or read it correctly when it did.
A handoff that never happens. W’s handoff path was built and never used. A path that is never exercised in testing is a path you don’t know works.
What to Take Away
- Known steps belong in code. On the questions with a predictable path, the fixed workflow had 18 successes of 24 against the agent’s 10, with fewer tokens and lower latency.
- A hybrid is only as good as its router’s “I don’t know.” In this experiment, the router never selected
other, so the hybrid’s agent fallback was never exercised. - A wrong route can still produce a right-looking answer. Count routing errors on their own, even when the reply happens to be acceptable.
- Giving an agent tools doesn’t make it investigate. It skipped the one tool that could find the duplicate charge, and misread the payments when it did look.
- Test the boundary before the system. Measure how often requests that fit no workflow are recognized as such.
Think About These Use Cases
-
An IT help desk: Password resets and access requests follow procedures; “my laptop is slow” doesn’t. How would you test that your router sends the second kind somewhere other than a procedure?
-
Order support: “Where’s my order?” has a fixed path. “My order arrived damaged and half of it is missing” may not. Which parts would you keep in code even inside an agent?
-
A router you inherited: It routes 99% of traffic to known intents. Is that good news? What would you measure before believing it?
-
Investigations with a budget: An agent investigates billing disputes, up to five model calls. How would you tell whether it reached the right records, not just whether its answer sounded right?
-
The handoff path: Your workflow hands unknown requests to people. How do you know the handoff still works if it hasn’t been triggered in months?
If you want to talk one of these through, take it to GPT along with this article. Ask GPT ↗️
Related Sources
- 02-agentic-workflows: The companion demo: the three systems, the frozen questions and grading rules, all 108 saved conversations with their hand labels, and a report script that re-grades without calling a model.
- Anthropic: Building effective agents (December 2024): The workflow patterns (prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer), agents, and when to use each. The page notes that the tooling it describes has changed since publication.
- OpenAI: A practical guide to building agents (PDF): When to build an agent, and when a deterministic solution may suffice.
- 01-tool-design: Article #23’s demo, whose model setup and tool lessons this experiment builds on.
What’s Next?
Every system here had one model making every model decision: routing, choosing tools, writing the reply. A common response to an agent that struggles is to add more of them, each with a narrower job: one to route, one to investigate, one to check the answer.
In the next article, we’ll look at Single-Agent vs Multi-Agent Systems: what a second agent actually adds, what it costs, and why more agents don’t automatically make a better system.