If you can draw the full step graph before the model runs, use a workflow. If the graph depends on what the model discovers at runtime, use an agent. That's the practical answer, and it's still the one that keeps teams from paying for autonomy they don't need.
The popular advice gets this backward by treating agents as the default “modern” choice. In production, the default should be workflow first, then agent only where discovery is the bottleneck. That's the cleanest way to control reliability, latency, cost per task, and governance, especially once a task leaves toy demos and hits actual users.
Table of Contents
- The Flowchart Test That Settles the Debate
- What Workflows and Agents Actually Are in LLM Systems
- Architectural Trade-offs Side by Side
- Four Reference Architectures You Can Ship This Week
- Cost and Latency Math Behind Every Decision
- Decision Criteria and Two Real Scenarios
- Hybrid Patterns That Beat Either Side Alone
- Production Checklist Before You Ship Either
The Flowchart Test That Settles the Debate
The simplest way to choose between agents vs workflows is to answer one question, can you draw the full graph before execution starts. If the answer is yes, you want a workflow. If the path depends on what the model discovers at runtime, you want an agent. That operational rule matches the long history of agentic systems, which traces from early ideas in the 1950s through ELIZA, intelligent-agent research, web agents, and then the LLM wave that accelerated in 2023 to 2026 with systems like AutoGPT and BabyAGI. The historical timeline matters because it shows this is not a new category, it's a shift from rigid automation toward dynamic orchestration.
Most “agentic” tasks are still workflows in disguise
Extraction, classification, fixed-slot RAG, and structured generation usually collapse into a deterministic graph once you sketch the edges. The model might still do the language-heavy work, but the control flow doesn't need to be open-ended. A lot of frameworks marketed as “agentic” are really a static graph wrapped in a ReAct loop, because autonomy sells better than a boring orchestrator.
A useful resource here is DocsBot's overview of autonomous agents for presales, because it makes the same distinction in a business context, not just a CS one. For a concrete example of how a fixed graph beats a loop when the path is known, see this single-command workflow example.
Practical rule: if the model is choosing between known steps, you probably built a workflow badly disguised as an agent.
The contrarian point is simple. Choosing an agent when a workflow fits costs you reliability tokens, latency, and debuggability you didn't need to spend. The rest of this guide assumes the graph is drawn, then asks where, if anywhere, runtime discovery is worth the trade.
What Workflows and Agents Actually Are in LLM Systems
A workflow is a directed graph of steps whose edges are known at design time. The developer owns control flow, branching, retries, approvals, and termination. The orchestrator can be LangGraph, Temporal, Inngest, or plain application code, but the important part is that the graph exists before the model runs. That's why workflows are easier to test and easier to reason about under load. Retool's breakdown gets this basic definition right, and Redis's rule of thumb is even plainer, if you can draw the flowchart before execution, use a workflow.
An agent is different because the model picks the next action at runtime. The orchestrator still enforces boundaries, but the model decides whether to call a tool, fetch context, retry, verify, or stop. That means state is more implicit, the tool graph is more dynamic, and the decision point moves from developer code into model output. Anthropic's 2026 report frames this shift as organizations moving beyond single-step automation toward multi-stage workflows that span teams.
The decision point is the actual distinction
In a workflow, your code says “go here next.” In an agent, the model says “I should do this next.” That sounds small, but it changes the whole system shape. A contract-clause extractor with five fixed steps belongs in a workflow. A coding assistant that decides whether to read a file, grep a repo, run tests, or stop belongs in an agent loop.
Engineering shortcut: if the next step can be selected without inspecting runtime state, keep it out of the model.
The distinction is also historical, not just architectural. The practical milestone wasn't one invention, it was a move over roughly seven decades from rigid automation to dynamic orchestration, with the modern agent wave becoming visible in 2023 to 2026. One useful way to think about it is that workflows encode knowledge into the graph, while agents ask the model to rediscover the graph at runtime.
For a deeper real-world pattern library, the agent workflow guide is a useful reference point when you're mapping the concept onto actual code.
Architectural Trade-offs Side by Side
The architecture choice is mostly a trade-off between control and adaptability. Workflows give you bounded behavior, agents give you runtime flexibility, and the cost shows up in the places production teams feel: reliability, latency, cost per task, debuggability, and governance. The right answer is usually not philosophical. It's about which failure mode you can tolerate.
| Dimension | Workflow | Agent |
|---|---|---|
| Reliability | Fails at known steps, easier to replay and isolate | Fails in novel ways, can loop or wander |
| Latency | Predictable because the call count is bounded | Variable because each step depends on runtime decisions |
| Cost per task | Tokens are spent on planned inputs and outputs | Tokens are also burned on planning, reflection, and recovery |
| Debuggability | Traceable node by node | Harder to reconstruct because the reasoning path is emergent |
| Governance | Approval gates map cleanly to the graph | Policy has to be enforced at the tool layer |
The reliability gap is the one teams underestimate first. A production-oriented estimate says that if each step is 95% reliable, a 20-step agent workflow succeeds only 36% of the time, and another estimate says 85% per-step reliability across 10 steps yields about 20% end-to-end success. That reliability math is why “just add one more agent step” is rarely free.
Latency behaves the same way. The more times the model has to decide, call tools, and recover, the longer the wall-clock time gets. Formal analysis of agentic workflows models end-to-end latency as the sum of sequential stage latencies, which is why each added reasoning turn or retry pushes directly on p95. The latency analysis makes the core point clearly, workflows are safer for strict response targets because the path is bounded.
For governance, the useful mental model is simple. Workflows map to approvals, audits, and exception handling naturally. Agents need tool-level policy because the path isn't known in advance. If you're shipping into a regulated or heavily reviewed environment, that difference matters more than the marketing language around autonomy. The Ollastack write-up is a good reminder that the backend matters as much as the model when you need those controls.
Four Reference Architectures You Can Ship This Week
Most production systems end up in one of four shapes. The point isn't to over-model the architecture, it's to pick the smallest control pattern that fits the task without smuggling complexity into the prompt.
Single-call workflow
Input goes in, one model call happens, output comes out.
Input -> LLM -> Output
request
-> prompt template
-> model call
-> validation
-> response
Use this for summarization, classification, extraction, or any task where the path is fixed and the result shape is known. It's the cheapest pattern to reason about and the easiest to wrap in tests. The OpenClaw workflow guide is a useful example of this style in practice.
Branching workflow
A router chooses among fixed handlers, then the selected branch completes the task.
Input -> Router -> Handler A / Handler B / Handler C -> Output
request
-> router
-> billing branch
-> support branch
-> sales branch
-> branch-specific model call
-> output
This works well for intent routing, clause extraction with fixed sections, or document pipelines where the branch set is known in advance. The PromptZone prompt directory is one place to compare prompt patterns, but the useful lesson is architectural, not cosmetic. You want the branching logic outside the model.
Single-agent loop
The model decides whether to read, call a tool, verify, or stop.
Goal -> Agent -> Tool / Context / Verify -> Stop
goal
-> agent loop
-> tool call
-> observation
-> optional retry
-> stop condition
Use this when the next action really depends on what the model just found. Research, incident triage, and messy external interfaces are the common cases. If the loop gets wide or long, set hard bounds early.
Multi-agent stack
A supervisor delegates to specialists.
User -> Supervisor -> Specialist A / Specialist B / Specialist C -> Final response
request
-> supervisor
-> specialist planner
-> specialist retriever
-> specialist writer
-> synthesis
-> output
This pattern is tempting, but the coordination cost rises fast. It's useful when subproblems are distinct, like code review plus test generation plus release notes. For a practical warning on orchestration complexity, avoid multi-agent pitfalls before you build the second specialist.
Cost and Latency Math Behind Every Decision
自治成本先表現在額外的 tokens 和額外的往返次數。固定 workflow 只為你預先設計好的呼叫付費,agent loop 還要再付 planning、re-planning、reflection 和失敗復原的成本。很多看起來更聰明的系統,實際上只是同一件事的更慢、更貴版本。
產線導向的 benchmark 模式顯示,把通用的程式生成 sub-agent 換成工具呼叫,在某個配置下可將 p50 latency 從 100 ms 降到 58 ms,直接呼叫架構則進一步降到 26 ms。另一個針對 MBPP 的 benchmark 顯示,LLM-based scheduler 把 token 消耗降了 63.4%,端到端 latency 降了 41.9%,準確率最多只下降 0.5 個百分點。這和 The architecture study 指向同一個結論,控制層越緊,常常比更高自治更划算。
| Architecture | Avg tokens/task | Cost/task (USD) | p50 latency | p95 latency | Retry rate |
|---|---|---|---|---|---|
| Single-call workflow | Lower and bounded | Lower and bounded | Predictable | Predictable | Low |
| Branching workflow | Slightly higher than single-call | Slightly higher than single-call | Still bounded | Still bounded | Low to moderate |
| Single-agent loop | Higher because of planning and recovery | Higher because of extra steps | Variable | More variable | Higher |
| Multi-agent stack | Highest due to coordination overhead | Highest in most cases | Variable and often slower | Tail latency grows quickly | Highest |
重點不是 agents 一定太貴,而是它們會為你沒有明確要求的工作付 token。對重複性高、schema 穩定的任務,這筆開銷特別不值得,因為模型只是反覆重建本來可以用工具或 workflow 直接寫死的規則。
Budgeting rule: if a step is stable enough to write down, stop asking the model to rediscover it on every run.
支援任務如果有十個步驟,workflow 和 agent loop 的成本差距會很快拉開。前者通常能維持在較低的成本曲線,後者可能貴到讓自治不再合理。若你在搭流程時也要一起估算模型與價格,PromptZone 的 model and pricing references 可以讓試算先落在現實範圍內,再去接系統。
Decision Criteria and Two Real Scenarios
The choice gets easier when you score the task on five checks. Look at determinism of inputs, variability of valid paths, UI or schema drift, auditability, and task scale. If most of the answers point toward known structure, use a workflow. If the structure itself appears during execution, use an agent.
Scenario A contract clause extraction
A clause extractor usually starts with known clause families, even if the language drifts over time. Auditors want step-by-step receipts, and the team usually wants stable output shapes. That points toward a branching workflow, because the router can send the document to fixed handlers while the model handles the language-heavy parts inside each branch.
The checks that matter most are input determinism and auditability. If the clause set is known and the output schema must stay stable, agent autonomy doesn't buy much. If the output quality regresses, the fallback is straightforward, route the same document through the workflow with stricter validation and human review.
Scenario B tier-1 incident response
An unfamiliar alert stream is the opposite problem. The valid path isn't known up front, the first useful clue may come from a log query, and the best next action depends on what the responder just found. That's where a bounded agent loop makes sense, because discovery is the bottleneck.
The checks that flip the decision are variability and runtime drift. The agent should still have tight guardrails, fixed tool choices, and a hard stop condition. If the loop starts wandering or the incident becomes repetitive enough to standardize, you can demote the stable parts back into a workflow and keep the agent only on the ambiguous edge.
Hybrid Patterns That Beat Either Side Alone
The strongest production systems usually split the work. A planner agent can choose which fixed workflow to invoke, or a deterministic workflow can treat one stage as a bounded agent loop. That hybrid shape keeps autonomy where discovery matters and forces predictability everywhere else.
A common support flow looks like this. Intake lands in a router, the router classifies intent, a fixed retrieval workflow fetches the right context, then a summarizer agent rewrites the response for the customer. The handoff points matter more than the model choice. The workflow owns the durable state and logging, while the agent owns the messy language generation at the edge.
The opposite pattern works too. A document pipeline can be a deterministic workflow where one step is an agent loop with bounded retries, especially when the document format changes faster than hard-coded rules can keep up. That's the right move for refactoring code, handling OCR noise, or dealing with user-generated content that doesn't stay still.
Rule of thumb: wrap the side with stable boundaries, and let the unstable side stay close to the model.
That same idea shows up in tooling. A lot of teams want a one-stop orchestration layer, but the backend still has to enforce tool constraints, retries, and state ownership. If you're looking at orchestration options, the PromptZone resources directory is a practical place to track adjacent tooling without confusing it with the architecture decision itself.
Production Checklist Before You Ship Either
- Start with a workflow sketch. Verification signal, the full path fits on one page.
- Measure baseline latency and cost per task. Verification signal, you have a before number for the deterministic version.
- Identify the single step where discovery is the bottleneck. Verification signal, only one step needs runtime choice.
- Promote only that step to an agent. Verification signal, the rest of the path stays fixed.
- Set hard loop limits and token budgets. Verification signal, the limit is present and tested.
- Log every tool call and prompt version. Verification signal, every run is replayable.
- Add a kill switch for runaway agents. Verification signal, ops can disable the loop without a deploy.
- Define a fallback workflow if the agent fails twice. Verification signal, the fallback returns the same output shape.
The reversibility rule is the one that keeps teams honest. If switching from workflow to agent, or back again, requires a rewrite, the boundary is wrong. Make the choice a config flag, not a new system.
If you're building this kind of system now, use PromptZone to compare model choices, pricing references, prompt patterns, and workflow examples before you ship. It's a practical place to cross-check whether a task really needs autonomy or just a cleaner graph.
Written with Outrank tool


Top comments (0)