DEV Community

杨子豪
杨子豪

Posted on Originally published at ai.dingboai.com

AI Agent vs Workflow: How to Choose for Real Work

This is the question we get most often when scoping a project, and the one teams most often get wrong. Choosing badly rarely stops the system from running. It stops you from maintaining it once it does.

The one-line test

If you can draw the next step before you start, build a workflow. Use an agent only when the next step depends on what the previous step turned up.

"Customer email comes in, classify it, look up the order, draft a reply from the right policy, send it to a person for review." You can draw that on paper today, so it is a workflow. "Take this pile of messy supplier files and turn it into a comparison table." You have to look at the files before you know what to do next, so that is a job for an agent.

Most business processes that are worth automating are the first kind. They happen every day, they follow a known route, and the company already has an opinion about what the right answer looks like. That is exactly why they are worth automating, and exactly why they do not need an agent deciding the route.

Where workflows win

  • Reproducible. The same input gives the same path today and next month. When a customer complains about one reply, you can rerun that exact case and see what happened.
  • Regression-testable. Change one step, replay a few hundred real historical cases, and see precisely which ones changed. You cannot do this cleanly with a free-running agent, because it takes a different path every time.
  • Easy to debug. You can see which step broke. You are not reading a long chain of model reasoning and guessing what it was thinking.

What you pay for making everything an agent

First, unstable results. Ask the same question twice, get two different handlings, and the business team decides the system is broken while you cannot reproduce the problem. Second, unpredictable cost: an agent that wanders can burn dozens of model calls on one task. Third, debugging by guesswork: when something goes wrong in production, what you have is a natural-language transcript, not a call trace.

None of these show up in a demo. All three show up once real volume arrives.

What we do: a graph outside, agents only inside single steps

Our customer service system is built as a graph. First it works out what the customer is asking this turn. Then code decides whether to look up the order, whether to search the knowledge base, and whether the case needs a person. Then it writes the reply. Classifying, retrieving, rewriting and drafting are separate steps, and the route between them is decided by code, not by the model.

Only the small part that genuinely needs exploration gets an agent that can call tools on its own, and that agent has a hard cap on the number of steps. The whole stays controllable, and the part that needs flexibility gets it.

This is also why "agentic workflow" is a useful phrase. It is not a third architecture. It is a workflow where some nodes are allowed to think, and the boundaries around them are explicit.

Tool design matters more than the framework

Whichever you pick, results come down to the handful of tools the model can call. Two lessons cost us real mistakes:

  • Describe when to call a tool, not just what it does. "Looks up an order" is not enough. "Call this when the customer mentions an order number, an email address used at checkout, or asks where a parcel is" is what changes behaviour.
  • Make a failed lookup look different from an empty result. If the order lookup times out and returns an empty list, the model reads that as "no such order" and confidently tells the customer it does not exist. A lookup needs four distinct answers: found, confirmed not found, partly found, and could not check. This kind of bug looks like a model hallucination. It is actually a code problem, and fixing it removed more wrong answers for us than rewriting prompts ever did.

A quick way to decide on your own project

Write the process down as numbered steps. If every step and every branch can be written before the work starts, it is a workflow, and putting an agent in charge only adds cost and risk. If one or two steps are "figure out what this is and what to do with it", put an agent inside those steps only, give it the tools it needs, cap its steps, and keep everything around it deterministic. If you cannot write the steps at all, the problem is usually not the architecture: the process itself is not defined yet, and no agent will define it for you.

For the problems that show up after launch, whichever architecture you choose, see why AI agents fail in production.


Originally published at ai.dingboai.com. Dingbo AI builds and runs AI agents for customer service, paid per completed task.

Top comments (0)