Agents vs. workflows: default to the workflow

2 min read

Updated

  • AI agents
  • Architecture
  • Production

Most production systems marketed as AI agents work better as code workflows with focused model steps. When an agent earns its complexity, and what it requires.

If you can draw the steps on a whiteboard, write a workflow. Put a model strictly inside the steps requiring judgment, and keep orchestration in ordinary code. Workflows cost less, run faster, fail predictably, and give every error an exact address: which step, which input, which owner.

A true agent, where a model chooses its own sequence of tool calls at runtime, earns its complexity only when the path genuinely varies from case to case. Even then, prompting is the easy part; the operating layer around the model decides whether it survives production.

What an agent needs before touching live state

An agent authorized to take real actions needs the same guardrails you would put around a brand-new hire:

  • Exclusive work claims. Two agents, or an agent and a human, must never edit the same record at once. Database-backed leases with heartbeats enforce that invariant in code instead of hope.
  • Human sign-off on high-stakes actions. Anything moving money or altering customer accounts starts behind human approval until real data proves it safe.
  • Bounded retries and escalation. After failing twice on the same item, the agent stops looping and hands off cleanly to a named person.
  • Queryable audit history. Every input, proposed action, approval and side effect lands in a table anyone can inspect later.

Without those four pieces, you do not have an autonomous agent. You have an unsupervised script.

Autonomy is a dial, set per action

In the support agent I built, every brand runs at one of three modes: off, draft for review, or draft and act. Support staff approve drafts until review history proves a ticket category ready to automate, while a global switch pauses live execution without halting drafting.

Two design traits matter more than where you start. First, autonomy lives at the action level, so canceling a paid subscription can remain manual while answering a shipping question runs automatically. Second, turning autonomy down must be just as fast as turning it up. If pulling an agent back requires a code rewrite, the architecture is broken.

Hard rules belong in code, not prompts

Constraints protecting money belong in deterministic code running over verified facts: does this subscription belong to this customer, does the quoted currency match billing, is every link on an allowlist. Those checks run both before approval and again at execution time, because an approval from an hour ago does not cover an account changed five minutes ago. Soft intent judgment belongs to the model and gets measured by evaluations, turning subjective arguments into numbers.

See the AI support agent case study for the approval and validation loop, and the job queue case study for atomic claims and heartbeats.

Bring one real problem

One hour, €80. You leave with a written plan for what belongs in AI, what belongs in code, and what a first release takes, whether we work together or not.