Subscribe for more posts like this →

Deep-dive 8 — Prefer the Workflow to the Agent

Share

Consequence from the field guide: default to the least dynamic structure that solves the problem. Chain first. Add routing when inputs are heterogeneous. Graduate to a loop only when you can name the specific dynamism that demands it. Every loop in your architecture should have to justify its own existence.


How it's done

This is the classical instinct that coordination is expensive and you avoid it when a simpler structure suffices — you don't reach for consensus or a distributed transaction when a local operation or eventual consistency will do. The agentic loop is the expensive coordination primitive here.

The escalation ladder:

  1. Chain — a fixed pipeline of steps, every run identical (summarize → extract → format). Deterministic, testable, cheap, debuggable, bounded in cost and latency.
  2. Router — a classifier or cheap model dispatches heterogeneous inputs to the right chain. Still mostly deterministic.
  3. Agentic loop — the model decides what to do next based on intermediate results, for an unknown number of steps, discovering the path as it works. Use only when the task genuinely requires this (a coding agent exploring an unfamiliar repo qualifies; "translate then summarize" does not).

The dominant production architecture is a deterministic backbone with intelligence deployed at specific steps — not a loop wrapped around everything.

Tools available

  • Chains / deterministic flow: plain code, LCEL-style pipelines, Prefect / Airflow for heavier orchestration.
  • Routing: a small classifier or cheap model as a dispatcher.
  • Graph / flow with optional loops: LangGraph (lets you express deterministic flow and graduate specific nodes to dynamic behavior).
  • The canonical decision guide: Anthropic's Building Effective Agents — its central recommendation is to start with the simplest pattern that solves the problem and add complexity only when it demonstrably helps.

Best practices

Default to a chain. Add routing for heterogeneity. Graduate to a loop only when you can name the dynamism (step count unknown in advance, path must be discovered at runtime). Make every loop justify its existence in review. Prefer deterministic structure wherever it hits the quality bar, because it is testable, cheap, and — crucially — has near-zero path variance, which makes it debuggable in a way loops never are. When you do need intelligence, deploy it at the narrowest step, not as the outer controller.

Failure points teams ignore — and what each costs

  • Over-agentifying. Using a loop where a chain would work, because "agents" are the exciting word. Consequence: you inherit nondeterminism, higher cost, higher latency, and un-debuggability — for zero benefit over a pipeline. This is the most common architectural mistake in the space, the LLM equivalent of reaching for Raft when a single writer would do.
  • Under-structuring. No deterministic backbone at all — one big autonomous loop. Consequence: reasoning drift and unobservability (see Deep-dive 7).
  • Confusing hype with need. Adopting multi-agent or fully-autonomous patterns because they signal sophistication. Consequence: coordination overhead and reliability loss with no task justification.
  • Unbounded loops. (Shared with Deep-dive 7.) Consequence: runaway cost and latency.
  • Never comparing loop to chain. Consequence: you never learn that the cheaper, more reliable structure would have met the bar, and you pay the agent tax indefinitely.

How to evaluate and mitigate

Evaluate: the decisive test is simple — does a deterministic chain hit the quality bar? If yes, you are done; ship it. If no, benchmark the loop against the best chain on your task across quality, cost, latency, and reliability variance (chains have near-zero path variance; loops have high, and that variance is a production cost). Only adopt the loop when its quality gain clears the reliability and cost it introduces.

Mitigate: start deterministic and escalate only on evidence; use hybrid designs (deterministic flow, intelligence at the leaves); cap loop iterations when you do use them.

Practical vs. still research

Fully practical: this is a design-discipline point, not a tooling gap. Chains, routing, and graph frameworks are mature, and the "avoid unnecessary coordination" instinct is exactly the one you already have from distributed systems. Apply it directly.

Still research: automated selection of the right structure for a task (today it's engineering judgment), and — the uncomfortable part — reliable autonomy for the genuinely open-ended tasks that do require a loop. The cases where you legitimately need the agentic loop are precisely the cases where reliability is worst, which is why the discipline of not reaching for it prematurely matters so much.

Read more