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 dynamically direct their own tool use trade latency, cost, and predictability for autonomy; 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 model-driven decisions at runtime.

Why it happens

An agentic loop pays a tax on every turn: each model-driven decision adds a round-trip of latency, more tokens, and a fresh chance to pick a wrong branch, so an open-ended loop is strictly more expensive and less predictable than a fixed code path for the same work. When a task has enumerable categories and a known decision structure, that structure belongs in deterministic code (a switch, a router, a state machine), with the model used only for the genuinely ambiguous judgment inside it. The failure mode is concrete: teams wrap a five-way classification in a multi-step reasoning agent that costs several model calls per item, occasionally invents an output that does not exist, and runs in seconds where a single classification call would run in well under one. The discipline is to reserve runtime model-driven control flow for problems whose branching genuinely cannot be enumerated in advance, and to script everything you can describe.

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. Promote to an agent only when the task's branching is too open-ended to script.

Sources and further reading

Related laws

Read every law in the digital edition Back to all 50 laws