One question separates the two
Does the next step depend on what the model finds?
In a workflow, your code decides the order of steps. The model gets called at known points to do one job each, such as reading a document or drafting a reply. In an agent, the model runs in a loop with a set of tools and picks its own next action until it decides the task is finished.
The test is whether you can draw the flowchart before the run starts. Try it on a few tasks:
- An invoice arrives by email. Extract the fields, match them to a purchase order, post the entry to the accounting system. You know the steps in advance, so this is a workflow.
- A support ticket comes in. Classify it, find the matching help article, draft a reply for a person to approve. Two model calls in a fixed order. Workflow.
- "Find out why this customer's data sync failed." You read the logs first. What you read next depends on the error. It might be the customer's settings, a recent deploy or a third-party status page. Nobody can draw that chart in advance. That is an agent's job.
Workflow and agent compared
| Workflow | Agent | |
|---|---|---|
| Who picks the next step | Your code | The model |
| Cost per run | Known in advance, because the number of model calls is fixed | Varies, because the loop might take three steps or thirty |
| Predictability | The same path on every run | Different paths for the same input |
| Debugging | Find the step that failed and fix its prompt | Read the whole trace to learn why it chose that path |
| Testing | Test each step by itself with its own examples | Grade whole runs from start to finish |
| How it fails | Stops at a known step with a known error | Loops, wanders off, or stops early and reports success |
| Suits | Tasks you can draw as a flowchart | Open-ended tasks where the findings set the path |
The last failure in that table is the expensive one. A workflow that breaks tells you where. An agent that stops early and says it is done gives you a wrong result that looks finished.
Spottal Brain does defined jobs
For Spottal, an AI hiring platform, we built Spottal Brain. It writes job posts and matches candidates to roles.
Both are defined jobs. Writing a job post starts from the details of a role and ends with a post. Matching starts from a role and a set of candidates and ends with a list of matches. Each has a clear input, a clear output and a known place in the product where it runs. A model that decides for itself what to do next would add cost and variance to jobs like these.
Plenty of products described as agents have this shape. Calling them agents does no harm in a pitch. Building them as agents means paying for freedom the task never uses.
Start with a workflow and add freedom one step at a time
- Do the task by hand several times and write down the steps.
- Mark the steps that need judgement about language, such as reading, classifying or drafting. Those get a model call. Everything else is ordinary code.
- Give each model call one job and ask for structured output with fixed fields, so the next step can check it before going on.
- Add a branch where the task needs one. A classifying step that sends the work down one of four paths is still a workflow.
- When you hit cases the branches cannot cover, let the model choose its own tools for that part alone, and keep the rest fixed.
There is room between the two ends. A router with a few branches, or a loop with a hard limit on steps, adds flexibility while your code keeps control of the order.
When an agent is the right call
Some tasks do need one.
- The path cannot be known in advance. Debugging, open research and work across a large codebase are the usual cases.
- The tools are many and the useful combinations are too many to write as branches.
- A person reviews the result before it counts, or every action can be undone.
If you build one, set the limits before the first run. Cap the number of steps and the spend per run. Give it read-only tools by default. Require a person's approval before anything that sends a message, moves money or deletes data. Log every tool call with its inputs, because that log is the only way you will debug it.
Check the other direction too. If a plain rule covers the case, such as sending every invoice above a set amount to a manager, write the rule and leave the model out. Much of workflow automation is rules and connections between tools, with a model only on the step that reads or writes language.
Bottom line: If you can draw the steps before the run, build a workflow and put model calls only where language needs judgement. Build an agent when what the model finds decides the next step.
When we scope AI products, the first thing we ask for is that hand-drawn flowchart. If it fits on one page with no "it depends" boxes, the agent question is already answered.
AI products. We build AI agents, search over your own documents and copilots inside the product you already run. Each one ships with LLM evals that run on every change, so you learn that answer quality has dropped before your customers do.
See the service→
