AI Agent Architecture: Workflow-Driven and Model-Driven Approaches
Building an AI agent system starts with deciding where control belongs: in a predefined workflow or in a model-led planning loop. This article compares both approaches, explains their engineering requirements and failure modes, and outlines how to combine them with clear validation, budget limits, access controls, and human oversight.
When enterprises adopt AI agents, they often confuse two different approaches: embedding a large language model into an existing software process, and allowing the model to decompose goals, choose actions, and verify results. The first is primarily software engineering, with the model serving as a replaceable processing component. The second is a model-native agent, with the model acting as the control center.
Both can improve automation, but their failure modes, cost structures, and acceptance criteria differ substantially.
Start by Identifying Who Controls Execution
In a workflow-driven system, the workflow controls execution. Designers specify node order, branching conditions, retries, and human review points in advance. The model performs classification, extraction, rewriting, or generation only at designated nodes.
Inputs and outputs have explicit contracts. Exceptions can fall back to predefined paths, and an audit can reconstruct which step ran, which prompt it used, and what it produced. This approach suits processes with relatively stable rules, strict compliance requirements, and a need for reproducible results. Examples include extracting document fields before approval, rewriting customer support responses within templates, and adding knowledge entries through a fixed sequence.
In a model-driven system, goals and policies govern execution. The system provides a task objective, available tools, and stopping conditions. The model decides which capability to invoke next, whether to retrieve more information, and whether to ask a person for clarification.
The control loop typically follows an observe–plan–act–reflect pattern. State resides in short-term memory and task context rather than being hard-coded into a workflow diagram. This approach suits open-ended tasks whose steps cannot be fully enumerated in advance, such as drawing conclusions across multiple documents, selecting among query strategies, or adjusting a plan based on intermediate results.
These approaches are not mutually exclusive. Mature systems are often hybrids: an outer workflow enforces permissions, budgets, and human approval gates, while an inner loop allows the model to plan autonomously within those boundaries.
The selection question is not simply “Do we need an agent?” It is “Which parts must be deterministic, and which parts can allow exploration?”
Workflow-Driven Systems: Treat the Model as a Reliable Processing Component
A workflow-driven system is a workflow with intelligent nodes. Its most important design concerns are contracts and failure handling—not elaborate prompts.
1. Give Each Node a Single Responsibility
A node should perform one task: classification, extraction, summarization, or format conversion. Define its input fields, output structure, and confidence thresholds explicitly.
When responsibilities are mixed, even a small prompt change can produce output that breaks downstream parsing.
2. Prefer Structured Output to Free Text
If downstream systems need to store results or call an API, require the model to return output in an agreed schema. Validate that output outside the model node.
Missing fields, incorrect types, and values outside an allowed enumeration should count as failures. Do not pass malformed natural language to another model and expect it to infer what was intended.
3. Keep Deterministic Logic in Code
Amount calculations, permission checks, state-machine transitions, and idempotency-key generation should not be delegated to the model.
The model handles semantics; code enforces constraints. This division reduces the impact of hallucinations and makes unit testing easier.
4. Handle Uncertainty Explicitly
Route low-confidence results to human review or secondary validation. Give timeouts, rate limits, and empty results separate branches. With constrained temperature settings, aim for reproducible results for the same input.
Predictability is the main value of a workflow-driven system. If every node improvises freely, the workflow exists in name only.
A processing node might look like this:
Input: source text, task instructions, output schemaSteps:1. Assemble a controlled prompt and a small set of examples2. Call the model with an output-length limit3. Validate against the schema; retry or escalate to a human on failure4. Record an input summary, version identifiers, and validation resultsOutput: a structured result or an explicit failure reason
Evaluate these systems using node success rates, human intervention rates, end-to-end latency, and rollback costs—not whether they appear to “think like a person.”
Model-Driven Systems: Goals, Tools, and Stopping Conditions
The core of a model-native agent is a closed loop, not a longer prompt. At minimum, it needs four elements.
Verifiable Goals
“Help me analyze this” is not a sufficient objective. Specify completion criteria: the questions to answer, the types of evidence that must be cited, and omissions that are unacceptable.
Without completion criteria, the loop can keep calling tools without knowing when the task is done.
Narrow, Well-Defined Tools
Retrieval, computation, read-only business queries, and draft submission should each have clear parameters, permissions, and descriptions of side effects.
Separate write operations from read-only operations. High-risk actions should not execute automatically by default. Ambiguous tool descriptions encourage parameter misuse, and those errors can compound across a multi-step plan.
Inspectable State
At each step, preserve the goal, collected evidence, remaining work, and reasons for failure.
Context windows are limited, so appending the entire history unchanged is not a sustainable strategy. Keep summaries alongside references: summaries support planning, while source text or record identifiers support verification.
Explicit Stopping Conditions
The loop should stop when it meets the completion criteria, reaches a step or cost limit, repeatedly finds no new information, or triggers a safety rule.
It should then report whether the task is complete, partially complete, or failed, together with the supporting reasons. In production, an autonomous loop without stopping conditions amounts to uncontrolled cost.
A minimal loop can be represented as:
while stopping conditions are not met:Decide the next step based on the goal and current evidenceif external information is needed:Call a read-only tool and record the sourceelif information is sufficient:Form a conclusion and check for missing evidenceelse:Ask a human or mark the task as blockedReturn: conclusion, evidence list, unresolved items
“Decide the next step” can mean that the model outputs an action directly, or that the model proposes an action and a policy module approves it.
The latter is more controlled: the policy module checks tool allowlists, parameter ranges, budgets, and sensitive fields. The model does not receive unrestricted authority.
Choosing an Approach—and When to Combine Them
Three questions provide a useful initial assessment.
Can the Execution Paths Be Enumerated?
If roughly 80% of cases follow the same three to five steps, start with a workflow-driven system and delegate only the semantic challenges to the model.
If each task involves different information sources and combinations of steps, trying to represent every possibility in a workflow can cause a branching explosion. In that case, confine exploration to a controlled part of the process.
What Is the Cost of an Error?
An incorrectly extracted field may be retried. An incorrect transfer, unauthorized query, or external message can have consequences that are not easily reversed.
High-impact actions must sit behind workflow gates and require rule-based or human confirmation. The model’s judgment that an action “seems acceptable” is not enough.
Can the Evidence Be Defined?
Tasks that can require citations to source text, records, or calculation results are good candidates for model-led retrieval planning.
Open-ended generation that cannot be verified should remain in low-risk settings and be explicitly labeled as a draft rather than a statement of fact.
A typical hybrid architecture uses a workflow at the entry point for identity checks, quotas, and task classification. A constrained planning loop then handles retrieval and synthesis. At the exit, another workflow validates formatting, filters sensitive information, and requires human approval before publication.
This preserves adaptability for open-ended problems without handing the entire business system over to a single generation.
Quality, Cost, and Governance
Both approaches require versioning. Prompts, tool descriptions, model-routing policies, and workflows should all have version identifiers so that production incidents can be replayed.
Build evaluation sets from real failure cases rather than relying only on demonstration tasks:
- Workflow-driven systems: Measure field-level accuracy and exception-branch coverage.
- Model-driven systems: Measure task completion rate, the proportion of ineffective tool calls, evidence coverage, and attempted actions outside authorized permissions.
Budget for the Entire Loop
Workflow-driven systems have a roughly fixed number of model calls, making costs easier to estimate. In model-driven systems, the number of steps varies by task.
Set limits on steps, tokens, and tool calls, with different budgets for different task types. Caching stable retrieval results and reusing intermediate conclusions for recurring subproblems is often more effective than simply switching to a larger model.
Enforce Least Privilege
Keep agent identities separate from user identities. Authorize tools by role, redact sensitive information in logs, and do not insert unfiltered confidential documents into prompts.
Treat all external content as untrusted data. Content that resembles an instruction must not be allowed to change system policy.
Human takeover should have an explicit entry point. Preserve enough state for the task to continue after intervention rather than requiring it to restart from scratch.
Use Cloud Infrastructure as Supporting Capabilities
For cloud deployments, object storage can hold source materials and execution traces. Message queues can carry asynchronous tasks between nodes, container platforms can host tool services, and logging, monitoring, and alerting can track timeouts, failure rates, and budget thresholds.
These are general infrastructure capabilities. Evaluate them for isolation, auditability, and elasticity rather than treating a particular orchestration interface as the architecture itself.
A Practical Implementation Sequence
Start with a narrow task. Choose a stage with clear inputs and outputs, historical examples, and errors that can be rolled back. Use a workflow-driven implementation to establish validation and observability.
Next, replace a genuinely variable subproblem with constrained planning, then compare human effort and error types. Expand autonomy only when evidence shows that fixed workflows cannot cover the main variations and that the safety gates work.
A well-engineered agent is not defined by being fully autonomous. It is defined by an appropriate allocation of control: deterministic where certainty is required, and able to explore where execution can still be stopped, audited, and assigned clear accountability.
Under that standard, both workflow-driven and model-driven systems can become maintainable engineering solutions rather than demonstrations that cannot be reproduced.
