Law 36 · Architecture & Operations

Don't Build an Agent When a Workflow Will Do

Agents buy flexibility with latency, cost, and unpredictability.

Diagram explaining Don't Build an Agent When a Workflow Will Do

The principle

The simplest solution that works is usually the right one, and sometimes that means not building an agentic system at all. Agents that direct their own tool use trade latency, cost, and predictability for autonomy, while a workflow with predefined code paths is cheaper and more reliable for well-defined tasks. Reach for an agent only when the problem genuinely needs the model making decisions at runtime.

Why it happens

An agent loop adds cost each turn: latency, tokens, state drift, and another chance to choose the wrong branch. If the task has known categories and a known decision structure, put that structure in code. Use the model for the ambiguous judgment inside the workflow, not for rediscovering the workflow every run. A five-way routing task is usually a classifier plus a switch, not an autonomous planner. Reach for open-ended agents when the branches cannot be listed ahead of time and runtime judgment is genuinely needed.

Watch for

In practice

A team wires up a multi-step ReAct agent to categorize incoming support tickets and route them to a queue. It costs three LLM calls per ticket, occasionally invents a queue that does not exist, and takes four seconds. The task has five known categories and one decision point: it is a single classification call feeding a switch statement, not an agent. Default to the deterministic workflow and reach for agentic loops only when the branching is genuinely open-ended and you cannot enumerate the paths in advance.

Apply it

  1. Default to a deterministic workflow with explicit code paths for any task whose branches you can list ahead of time.
  2. Use the model only for the ambiguous judgment inside the workflow, not for control flow you could script.
  3. Promote to an agentic loop only after you confirm the branching is genuinely open-ended and cannot be enumerated.

The takeaway

Default to a deterministic workflow. Move up to an agent only when the branching is too open-ended to script.

Sources and further reading

Related laws

Get the audit kit Access the buyer edition Back to all 50 laws