Agent Architecture: Should the Program or the Model Decide the Next Step

The difference between Workflow, Autonomous, and Hybrid is not the framework but who decides the next step. This article covers when each pattern fits, how each one fails, and a selection method that starts from task conditions.

On this page · 12 sections

“Do we use LangGraph or write our own loop?” This is the most common first question in an Agent project, and the least meaningful one. A framework is a means of implementation. The question that actually has to be answered first is: in this system, who decides what to do next?

The essence of an Agent is plain: it runs continuously toward a goal, reads the current state, chooses the next action, calls tools, and keeps moving based on feedback. Every difference between architectural paradigms comes down to who is handed the job of “choosing the next step.”

The Short Version

  • Start selection by asking “who decides the next step,” not by picking a framework: keep control in the program when the path is known, and do not hard-code it when the path is unknown.
  • Enterprise scenarios are almost always Hybrid, and the key is knowing who sits at the top; delegation and invocation both need an explicit call contract and return contract.
  • The trend is the autonomous Agent as the main brain, with Workflow sinking down into capabilities called on demand; investment should move to capability descriptions, hard permission boundaries, and independent verification.
  • Selection starts from the task’s four conditions to get candidates, then uses experiments comparing quality, cost, and latency rather than intuition.

The Control Spectrum

Agent architecture selection: who holds control; open the full-size SVG

  • Workflow: the program decides the next step, and the model completes a local task inside each node.
  • Autonomous: the model decides the next step, and the program provides tools, boundaries, and verification.
  • Hybrid: the two divide the work, and the difference lies in who stands at the top.

The Workflow Side: When the Path Is Known, Do Not Make the Model Guess

When a task’s stages are stable and its intermediate artifacts can be checked, keeping control in the program is the cheapest and most reliable choice. The table lists five common patterns; for each row, compare what it suits with its main cost.

Pattern What it suits Main cost
Chaining Fixed stages where each step’s output can be verified, such as generating a report section by section Latency adds up; early errors propagate downstream
Routing Known exits where classifying is easier than solving, such as customer service triage Possible misclassification; adding an exit means changing code
Parallelization Subtasks that are independent and must all produce a result, such as multiple compliance checks on a contract Poor flexibility; high orchestration and maintenance cost
Evaluator-Optimizer Results that can be verified externally, such as SQL repair The evaluator misjudges; multiple iterations do not necessarily converge
Orchestrator-Workers and Agentic Workflow Work that needs dynamic decomposition, or a local Agent embedded at an agreed point in the flow Decomposition may overlap or leave gaps; long-tail branches bloat the flowchart

The strength of Workflow is that business boundaries and responsibility boundaries are explicit: who approves, and at which step execution happens, are written into the graph. Its cost is just as clear: the paths are maintained by people, and a model upgrade does not automatically improve the top-level flow.

One criterion: the parallel pattern is only worth it when “completeness is a hard requirement,” meaning every one of five checks must return a result. If you just want to “look from a few more angles,” that is a different problem, which I discussed specifically in Multi-Agent Review: Splitting the Work, Isolating It, and Combining Results.

The Autonomous Side: When the Path Is Unknown, Do Not Hard-Code It

When the next step depends on what the previous step observed, a flowchart drawn in advance becomes an obstacle.

  • ReAct (decide → act → observe) is the basic behavior of an autonomous Agent. It is simple to implement and responds quickly to changes in the environment, which suits exploratory tasks such as incident investigation and debugging. Its weakness is short-sightedness: it lacks global planning, long tasks drift away from the goal, and frequent trial and error drives up cost.
  • Plan-and-Execute with replanning gives long tasks a global view: the plan records dependencies and completion evidence, and execution feedback is used to re-check assumptions. Its weakness is that the initial plan may be inaccurate, and over-planning both wastes Tokens and reduces flexibility. A common combination in practice is a coarse-grained plan, ReAct within each step, and replanning at milestones; and every change to the plan should have evidence that triggered it.
  • Reflection and Verifier guidance have the Agent locate the problem first, then use external evidence to steer the change. This is highly sensitive to Verifier quality: an unreliable Verifier will steadily lead the Agent in the wrong direction. When evidence is missing, the correct behavior is to stop and report, not to keep “optimizing.”
  • Delegation hands a subtask to a sub-Agent with its own independent context. It looks similar to the Workflow parallel pattern, but the essential difference is that the model decides whether to delegate. The benefit is specialization and context isolation; the cost is coordination overhead and governing consistency when the results are merged.
  • Deep Agent and Harness is, strictly speaking, not a new paradigm. It is a whole environment that integrates the patterns above and supports long-running tasks: file-based state, resumable progress, and a system of tools and permissions. It is the most capable, and it carries the highest engineering complexity.

I wrote a Harness like this myself, and later cut it back heavily. Both experiences are recorded in the Harness series and this retrospective. The conclusion: every mechanism in a Harness is an assumption about model capability, and it has to be re-verified with each model version.

Hybrid: The Norm in Enterprise Scenarios

Pure Workflow does not generalize well enough, and pure Autonomous struggles to carry strong safety requirements, so real systems are almost always mixed. The key is being clear about who is at the top.

Workflow-first

A fixed process manages how the business moves forward, the Agent explores only inside local nodes, and results enter deterministic execution only after verification and approval. This suits scenarios with strong safety and compliance requirements, such as credit approval and production release. It is not very “AI-native,” but it is safe and reliable enough, and it is the most natural evolution path for most existing Workflow systems.

Autonomous-first

The Agent manages the goal and the next step, stable SOPs (that is, standard operating procedures) are packaged as capabilities it can call on demand, and high-risk writes can only be completed through controlled capabilities. This suits tasks whose path changes with feedback, such as deep research, data analysis, and programming. It has three risk points:

  • unclear capability descriptions lead to wrong selections;
  • failure recovery is more complex;
  • the underlying permissions must be able to prevent bypass.

There is a design point here that is easy to blur: “discovering a capability” and “obtaining permission to execute it” should be implemented separately. The Agent can know that an “issue refund” capability exists, but whether it may execute it is decided by Policy (that is, the runtime authorization policy) at runtime.

Call Contract and Return Contract

When an Agent calls a piece of Workflow, or a main Agent delegates to a sub-Agent, both sides need an explicit contract. I require at least the following to be written down:

Call contract     input, permission scope, allowed actions, state ownership, cost and time budget
Return contract   completion evidence, return value, failure semantics, rollback and compensation, who control is handed back to

A delegation without a return contract always ends up as “the sub-Agent says it finished,” and saying “done” proves nothing.

The Trend: Autonomy Becomes the Main Brain, Workflow Sinks into Capability

The direction is clear: enterprise Agents are moving from “Workflow-led” to “Autonomous-led.” Workflow will not disappear, but it is no longer the top-level frame. It sinks down as a Skill, Tool, Policy, or subgraph that the Agent calls dynamically.

For engineering teams, this means a shift in where to invest:

  • invest less in “drawing every path in advance”;
  • invest more in clear capability descriptions, hard permission boundaries, and independent verification of results;
  • package business SOPs that have already stabilized into enterprise capability assets that are callable and verifiable.

A Selection Method

I do not start selection from a paradigm. I start from task conditions, derive candidate designs, and then test them by experiment.

Step one: describe the task’s four conditions. For each condition, see which side of the table the task sits closer to.

Condition Leans Workflow Leans Autonomous
Path Steps are stable and can be enumerated in advance The next step depends on what is observed
Dependencies Dependencies between stages are clear Dependencies only surface during execution
Feedback Intermediate artifacts can be validated by rules Assumptions need to be adjusted based on feedback
Execution boundary Heavy side effects that must be approved Mostly reading and analysis

Step two: combine patterns by scenario. Two systems can both be Hybrid and still be combined in completely different ways:

Scenario Top-level architecture Common combination
Structured extraction Workflow Chaining + Schema validation
Knowledge Q&A Workflow or Hybrid Routing + retrieval + evaluation
Customer service inquiries Hybrid Routing + specialist Agent + handoff
Refunds and claims Workflow-first Process-led, with local Agents plus rule validation
Data analysis, deep research Autonomous-first The plan manages dependencies, ReAct watches feedback, replanning revises assumptions
Programming tasks Autonomous-first Plan + ReAct + Verifier + delegation

Step three: decide by experiment, not intuition. Compare the candidates on quality, cost, and latency across a representative set of tasks. If a more “advanced” architecture brings no measurable gain on your tasks, it is simply more expensive.

Four Signals I Watch For

  • Using multi-Agent for the sake of multi-Agent. Multi-Agent is appealing, but it is still in an exploratory phase; what is scarcer right now is reliability design.
  • Treating framework fluency as the core skill. Frameworks get replaced; the underlying problems of control, state, and contracts do not.
  • Letting the party being verified serve as the Verifier. Self-assessment can be a signal. It cannot be a gate.
  • Relying on the Prompt to enforce permissions. As long as a tool has write permission, “do not do this” in a Prompt is not a boundary.

The next article covers the question that follows once the architecture is chosen: how to turn probabilistic generation into delivery you can be accountable for.

Note

This article is my notes and second-pass thinking after studying material from an enterprise Agent engineering architecture course (“企业级 Agent 工程架构实战营”), and it also draws on Anthropic’s Building effective agents. The structure, wording, and diagrams are all rewritten, and the judgments are my own.

Related notes

Working on something similar?

I'm always happy to compare notes on distributed systems, delivery, and applied AI.

[email protected]