Agents are the hype: autonomous AI that reasons, plans, calls tools, and "figures it out."
Production reality is simpler:
Most tasks that look like agents are better solved as workflows with an LLM step.
This post builds the mental model so you can choose correctly.
The Only Definition That Matters: Control Flow
The difference is not "smart vs not smart."
It's who controls the sequence of steps.
Workflow
A predetermined sequence (possibly with branching). The system controls flow; the LLM is a component inside it.
Example:
classify → retrieve → rerank → generate → cite
Agent
A control loop. The model chooses what to do next based on state and tool results.
Example:
observe → decide next action → call tool → update state → repeat
Same LLM. Different control plane.
The Agent Tax (Why Agents Feel Expensive)
Agents buy flexibility, but you pay in:
- non-determinism: harder to reproduce and debug
- latency: multiple LLM calls per task
- cost: each extra step multiplies spend
- safety risk: more opportunities to do the wrong thing
- test complexity: you can't enumerate all paths
If you don't need autonomy, you're paying the tax for nothing.
When Workflows Win
Default to workflows when:
1) The steps are knowable in advance
If you can write the sequence without seeing the input, you don't need an agent.
2) Reliability matters more than flexibility
Support bots, compliance answers, high-volume customer flows.
3) You need strict governance
Audits, permissions, predictable tool usage.
4) You want debuggability
If something fails, you want "step 3 failed" - not "the model made a bad decision earlier."
When Agents Earn Their Complexity
Agents make sense when the path is not knowable in advance.
Common patterns:
1) Dynamic tool selection
Many tools exist, and which one to use depends on the situation.
Examples:
- triaging incidents
- choosing between search, database query, API call, calculator, etc.
2) Multi-step tasks with dependencies
The next step depends on what the previous step returned.
Examples:
- investigative debugging
- multi-source research with follow-ups
- "collect info → verify → act → report"
3) Exploratory reasoning loops
You want iterative improvement, not a one-shot response.
Examples:
- writing + critique cycles
- planning and revising strategies
- troubleshooting unknown errors
4) Human-in-the-loop navigation
The conversation itself is part of the product: users steer the process.
The Hybrid That Actually Ships
Most real systems are:
Workflows with agent-like pockets.
A common production pattern:
- deterministic routing (classify intent)
- tool call (retrieval / DB / API)
- LLM synthesis (answer / summary)
- deterministic validation (schema checks, safety checks)
- return result
You get LLM capability without letting the LLM drive the whole program.
State Machines: The Middle Ground
When you need branching but not full autonomy, use a state machine.
- define states (collect info, confirm, execute, respond)
- define transitions (conditions for moving between states)
- allow the LLM to operate within a state, not across the whole system
This is often the best production compromise: flexible, but controllable.
ReAct (The Canonical Agent Loop)
A common agent design is ReAct (Reason + Act): interleave reasoning with tool use.
A practical shape looks like:
State: what we know so far (facts, constraints, tool outputs)
Goal: what success looks like
Loop:
* Decide next action (tool call or final answer)
* Execute tool
* Update state with observation
* Stop when goal met or max steps reached
Production note: you usually don't need to store private "chain-of-thought" to debug agents. Log the action trace instead:
- which tool was called
- with what arguments
- what it returned
- what decision was made next (as a short structured label)
That gives you observability without storing sensitive internal reasoning.
A Decision Framework (Default to Workflows)
| Characteristic | Workflow | Agent |
|---|---|---|
| Steps known in advance | ✅ | ❌ |
| High reliability required | ✅ | ❌ |
| Low cost / low latency | ✅ | ❌ |
| Easy debugging | ✅ | ❌ |
| Open-ended tasks | ❌ | ✅ |
| Dynamic tool selection | ❌ | ✅ |
| Iterative exploration | ❌ | ✅ |
| Human-guided navigation | ❌ | ✅ |
Default to workflows. Promote to agents only when measurement proves you need autonomy.
Common Agent Failure Modes (So You Don't Get Surprised)
- tool thrashing: calls tools repeatedly without progress
- early wrong turn: a bad decision early cascades into a wrong final answer
- silent assumption: the agent invents a constraint and follows it
- over-broad scope: one agent tries to do everything and becomes brittle
Mitigations:
- max step limits + timeouts
- validation after each tool call
- explicit stop criteria
- narrow scopes (specialized agents > one mega-agent)
Debug Checklist
If an agent misbehaves:
- Did it call the wrong tool, or call the right tool with wrong arguments?
- Did a tool return unexpected output (and was that handled)?
- Did the agent loop? (repeated actions with no new information)
- Where was the first wrong decision? (often earlier than the symptom)
- Can the task be rewritten as a workflow with explicit steps?
If the last question is "yes," you probably don't want an agent.
Try This Yourself
Pick one task and implement it both ways:
- Workflow:
route → retrieve → generate → validate - Agent: give tools and a goal, let it decide steps
Compare:
- cost (calls)
- latency
- success rate
- failure diagnosability
For many tasks, you'll find workflows win. When they don't, you've found a real agent use case.
Key Takeaways
- The difference is control flow: workflows are system-driven, agents are model-driven
- Agents pay a tax in reliability, cost, latency, and debugging complexity
- Most production systems ship as workflows with LLM steps
- Use agents when the path is genuinely not knowable in advance
- If you can turn it into a state machine, you can usually avoid full autonomy
Key Terms
- Workflow: fixed sequence (with optional branching) controlled by code
- Agent: control loop where the model chooses the next action
- State machine: structured control with defined states and transitions
- ReAct: a pattern that interleaves reasoning and tool use
- Action trace: logged tool calls + outputs + step decisions (debuggable without raw reasoning)
Further Reading
- “ReAct: Synergizing Reasoning and Acting in Language Models” (Yao et al., 2022): https://arxiv.org/abs/2210.03629
What's Next
Whether you use workflows or agents, you'll need them to take actions safely.
In the next post Tool Calling & Guardrails, we'll cover how to give LLMs tools, validate outputs, and contain failures.
Leave a Comment
Comments (0)
Be the first to comment on this post.
Comments are approved automatically.