The Zeroic Journal

AI agent vs workflow: which one your product needs

Most products need a fixed outer flow with an agent inside one or two steps. Here is the test, the four limits to set, and a table to decide by task.

On this page 5 sections
  1. Use a workflow when you can draw the steps
  2. AI agent vs workflow: what changes in production
  3. Put the agent inside one step
  4. Decide by task
  5. How Better Analyst runs agents for 1.5M+ users

AI agent vs workflow comes down to one test: can you draw the steps before the model runs? If yes, build a workflow. Even at 99% reliability per step, a 10-step chain succeeds only about 90% of the time. If you can’t draw the steps, use an agent inside one bounded step, with an iteration cap.

Most teams get this wrong by starting with the agent because the demo looks better. The demo hides the bill, the latency and the runs that wander. The better default is a fixed outer flow that you can test, with an agent only where the path can’t be known in advance.

Use a workflow when you can draw the steps

Anthropic’s guide to building effective agents separates the two by who holds control. Workflows are “systems where LLMs and tools are orchestrated through predefined code paths.” Agents are systems where “LLMs dynamically direct their own processes and tool usage.” The same guide tells builders to find the simplest solution possible and add complexity only when needed, and notes that for many applications a single LLM call with retrieval and examples is enough.

LangGraph’s docs draw the same line. Workflows have predetermined code paths and run in a set order, while agents are dynamic and define their own process and tool use. Their guidance: pick a workflow when the steps can be broken down and verified in a known order, and an agent when the path can’t be predicted.

Five patterns cover most workflow needs, all described in Anthropic’s guide:

  • Prompt chaining. One call’s output feeds the next, with a code check between steps.
  • Routing. Classify the input, then send it to a specialized handler. Our post on when a decision model beats an LLM covers the classifier side.
  • Parallelization. Run independent checks at the same time, or run one task several times and vote.
  • Orchestrator-workers. A model splits the task at runtime and delegates to workers.
  • Evaluator-optimizer. One call generates, another critiques, and the loop ends on a quality bar.

Each of these keeps the control flow in code. You can trace a failed run, reproduce it and predict how many calls it makes.

AI agent vs workflow: what changes in production

An agent trades predictability for flexibility, and you pay in three places.

Cost and latency. Anthropic says agentic systems often trade latency and cost for better task performance, so the tradeoff has to earn its place. Every extra loop turn is another model call that re-reads the growing conversation. Our guide to cutting OpenAI API costs shows why long contexts are where bills climb.

Compounding errors. Redis walks through the math: at 99% reliability per step, a 10-step process succeeds about 90% of the time, and it degrades faster as chains lengthen. At 95% per step, the same 10 steps succeed about 60% of the time (our arithmetic, assuming independent steps). Failures in practice aren’t independent, but the direction holds. Anthropic’s guide names “the potential for compounding errors” as a cost of autonomy.

Debugging. A workflow failure points to a step. An agent failure means replaying the whole trace to find the decision that went wrong.

None of this makes agents a bad choice. It makes them a choice with a price, so spend it where the flexibility pays.

Put the agent inside one step

The pattern that holds up is a deterministic outer loop with an agent inside a bounded step. Your code handles intake, validation, permissions and output formatting. The agent gets one job, a short list of tools and a budget.

The loop itself is simple. Per the Claude docs on how tool use works, a client-side agent is a while loop: the model returns stop_reason: "tool_use", your code runs the tool and sends back the result, and the loop repeats until the model returns another stop reason such as end_turn. Because your application drives that loop, your application can also end it.

Four limits turn that loop into something you can ship:

  1. An iteration cap. Anthropic recommends stopping conditions such as a maximum number of iterations. Pick the number from traces: run your own examples, find the longest successful run, and cap slightly above it.
  2. A token or dollar cap per run. Without one, a looping agent can accumulate unbounded spend, as Redis points out. Track it in the outer loop, not in the prompt.
  3. A fixed tool list. LangGraph’s docs note that developers still define the toolset and behavior guidelines. Fewer, clearly separate tools give the model fewer wrong turns.
  4. An escape hatch. When a cap hits or a tool errors twice, stop and hand the case to a person with the trace attached. Don’t retry in a loop.

Voice agents show the same split in practice. The call flow is fixed, and the model handles only the open-ended parts. We cover it in AI voice agent architecture.

Decide by task

Match the task to the row. If it fits two rows, take the simpler one.

TaskPickWhy
Summarize, classify or extract from one inputSingle model callNo loop needed; add retrieval or examples first
Fixed sequence: draft, check, translate, publishWorkflow (prompt chain)Steps are known, so every path is testable
Inputs of different types need different handlingWorkflow (routing)One classifier, then specialized handlers
Independent checks on the same inputWorkflow (parallelization)Run together, merge in code
Subtasks depend on what the model findsAgent in a bounded stepThe path can’t be drawn in advance
Open-ended analysis over many tools or data sourcesAgent with all four limitsNeeds tool choice at runtime; cap it and log everything
Anything touching money, health or legal dataWorkflow outside, agent only for draftsA person or a code check approves the action

How Better Analyst runs agents for 1.5M+ users

Better Analyst (formerly FormulaBot) is the clearest case we have for the hybrid. It serves 1.5M+ people, and its core is an English-to-SQL pipeline with fixed stages: schema in the prompt, generation, validation, execution and rendering. We cover what broke along the way in English-to-SQL at a million users.

The analysis agents sit on top of that. We built an LLM-driven code execution engine with LangChain agents, LangGraph workflows and GPT-4o. It reasons through multi-step analysis, transforms the data and recovers when a step fails. A FastAPI backend streams results over WebSockets, and the Python runs in E2B sandboxes, so a failed step can’t touch anything outside its box.

The same split works at a smaller scale. Bowie, a proof of concept we built for artist managers, keeps its workflows in n8n and lets the agent pull the music analytics each question needs through the Model Context Protocol (MCP).

The lesson is the split. Stages where the answer is checkable stay in code. The agent gets only the part where the next step depends on what the data looks like. If you’re deciding where that line falls in your product, our AI audit maps it step by step, and if you’re building the product from scratch, our AI MVP development service tests the agent on real data before the rest is built.

Frequently asked questions

What is the difference between an AI agent and a workflow?
In a workflow, your code decides the order of steps and the model fills in each one. In an agent, the model decides what to do next and which tools to call, looping until it judges the task done. Anthropic defines workflows as predefined code paths and agents as systems where the model directs its own process.
When should I use an AI agent instead of a workflow?
Use an agent when you can't write the steps down before the model runs, for example when the next action depends on what a tool returns. If you can draw the flowchart in advance, use a workflow. It costs less, fails in ways you can test, and is easier to debug. Start with a workflow and add an agent to one step.
How many iterations should an AI agent be allowed?
Set a hard cap, and pick the number from your own traces. Run the task on your own examples, find how many tool calls successful runs need, then cap slightly above the longest successful run. Anthropic recommends stopping conditions such as a maximum number of iterations. When the cap hits, hand off to a person instead of retrying.
Are AI agents less reliable than workflows?
Usually, because errors compound across steps. Redis notes that even at 99% reliability per step, a 10-step process succeeds only about 90% of the time, and the gap widens as chains grow. Workflows limit this by keeping most steps in code and checking output between them. Agents need extra guardrails to match.
Can I combine an agent and a workflow in one product?
Yes, and most production systems do. Keep a deterministic outer flow for intake, validation, permissions and output formatting, and let an agent handle one bounded step that needs tool choice, such as analysis or research. The outer flow enforces limits, so a stuck agent can fail one step without taking down the whole run.

References

  1. Anthropic - Building effective agents
  2. LangChain - Workflows and agents (LangGraph docs)
  3. Claude API docs - How tool use works
  4. Redis - AI agents vs workflows: when to use each

More from the journal

Hear from Prashant within 24 hours.

Prashant Abbi Partner @ Zeroic

Not sure which parts of your product need an agent? An AI audit maps each step of your flow to a workflow, a single model call or an agent, with the loop limits and costs for each. You get a ranked report in days.

See the AI audit, or book a 30-minute call