Begin with the problem
Workflows follow planned paths; agents choose paths at runtime. More autonomy adds flexibility and also cost, latency, and failure modes, so architecture should stop at the least autonomous option that works.
known steps → workflow | dynamic next step → agent | independent specialties → multi-agent
What you will learn
- Compare deterministic workflows, LLM workflows, agents, and multi-agent systems.
- Use task uncertainty and plannability to select an architecture.
- Explain the reliability and control cost of added autonomy.
Current production grounding: Google’s Gemini tools documentation distinguishes managed built-in tools from custom functions executed by the application.
These links document current public features and practices. They do not reveal a provider’s private implementation or guarantee that every product uses identical defaults.
1. The Engineering Problem
Your Agents course established the plannability test and the “least autonomous architecture” principle. This module turns that principle into a four-way comparison — deterministic workflow, LLM workflow, agent, and multi-agent — with concrete trade-offs across reliability, cost, latency, and control, so this becomes a repeatable architectural decision rather than an intuition call.
2. The Four-Way Spectrum
| Architecture | What It Is |
|---|---|
| Deterministic workflow | Every path mapped in advance — no LLM involved in the control flow at all |
| LLM workflow | A fixed sequence of steps, but individual steps use an LLM for judgment (e.g., classification) |
| Agent | dynamic, multi-step reasoning — the system itself decides what to do next at runtime |
| Multi-agent | Multiple specialized agents coordinating (your Agents course’s Module 15) |
This spectrum runs from FULLY deterministic to FULLY autonomous — and directly your Agents course’s principle: use the LEAST autonomous point on this spectrum that solves the problem.
3. Comparing Across the Engineering Dimensions
| Dimension | Deterministic Workflow | LLM Workflow | Agent | Multi-Agent |
|---|---|---|---|---|
| Reliability | highest — fully predictable | High — only individual steps vary | Lower — more unpredictable | Lowest — compounds unpredictability |
| Cost | lowest — minimal/no LLM calls | Moderate — one LLM call per relevant step | Higher — multiple, iterative calls | Highest — multiple agents’ worth of calls |
| Latency | fastest | Moderate | Slower — multiple round trips | Slowest — compounds further |
| Control | full — every path is known | High — structure is fixed | Lower — emergent behavior | Lowest — emergent AND distributed |
| Debuggability | easiest — deterministic | Easy — isolated LLM steps | Harder — multi-step reasoning trace needed | Hardest — which agent caused what |
Notice EVERY dimension gets WORSE as you move toward more autonomy — this isn’t a coincidence, it’s WHY the “least autonomous architecture” principle exists. Autonomy is a trade: you gain FLEXIBILITY for unpredictable tasks, at the real cost of every other dimension in this table.
4. The Plannability Test, Restated for Engineering
Decisions
Can EVERY possible path through this task be mapped out in advance?
YES, and NO step needs LLM judgment --> DETERMINISTIC WORKFLOW
YES, but SOME steps need LLM judgment --> LLM WORKFLOW
NO, needs dynamic reasoning --> AGENT
NO, AND needs specialized,
distinct roles working together --> MULTI-AGENT
5. A Real-World Analogy — The Factory, Once More
Module 5's factory analogy: a DETERMINISTIC WORKFLOW is
like an assembly line -- every step fixed, fast, reliable,
cheap.
An LLM WORKFLOW is like an assembly line with ONE quality-control
station staffed by a skilled inspector making a JUDGMENT
call -- still mostly fixed, but with ONE point of real, human-like
judgment.
An AGENT is like a GENERAL CONTRACTOR figuring out, in real time,
what needs to happen next on a novel job -- more flexible,
but slower, costlier, and harder to predict.
Using a general contractor to assemble something the assembly line
could handle is real waste.
6. A worked developer example
TechCorp evaluates three different features against this module’s spectrum:
| Feature | Analysis | Architecture Chosen |
|---|---|---|
| Refund approval (fixed eligibility rules) | Every path knowable in advance | Deterministic workflow |
| Support ticket urgency classification | Fixed structure, but needs LLM judgment per ticket | LLM workflow |
| Investigating a novel, multi-system billing dispute | needs dynamic, multi-step reasoning | Agent |
7. How Is This Used in the Industry?
🤖 How Is This Used in the Industry?
Mature AI engineering teams default toward the LEFT side of this spectrum — starting with a deterministic or LLM workflow, and only escalating to a agent when real, observed task complexity demonstrates the need — directly avoiding the reliability, cost, and debuggability costs Section 3’s table makes concrete.
8. Common Mistakes
Incorrect idea: Defaulting to an agent because a task involves an LLM at all.
Why it is incorrect: This shortcut removes a validation or control boundary, allowing an error to pass into later stages where it becomes harder and more expensive to detect. As shown directly in Section 3, this trades away reliability, cost, and debuggability without a corresponding benefit for plannable tasks.
Incorrect idea: Not recognizing an LLM workflow as a distinct middle option.
Why it is incorrect: As shown directly in Section 2, many tasks need ONE point of LLM judgment within an otherwise fixed structure — not full agentic autonomy.
Incorrect idea: Choosing multi-agent for flexibility without a real, specialized-role justification.
Why it is incorrect: As shown directly in Section 3, multi-agent compounds every cost dimension further.
9. Code — An Architecture Recommendation Function
What this shows: implementing Section 4’s plannability test directly — a function walking the spectrum from deterministic workflow through agent, exactly Section 6’s worked developer example made into working, repeatable decision logic.
from dataclasses import dataclass
from enum import Enum
class ArchitectureChoice(Enum):
DETERMINISTIC_WORKFLOW = "deterministic_workflow"
LLM_WORKFLOW = "llm_workflow"
AGENT = "agent"
MULTI_AGENT = "multi_agent"
@dataclass
class ArchitectureRecommendation:
choice: ArchitectureChoice
rationale: str
def recommend_architecture(all_paths_knowable: bool, needs_llm_judgment_per_step: bool,
needs_dynamic_multi_step_reasoning: bool, needs_specialized_roles: bool) -> ArchitectureRecommendation:
"""Directly implements Section 4's plannability test -- 'use the
LEAST autonomous architecture that solves the problem' -- checking
simpler options BEFORE reaching for full agentic
autonomy."""
if all_paths_knowable and not needs_llm_judgment_per_step:
return ArchitectureRecommendation(ArchitectureChoice.DETERMINISTIC_WORKFLOW,
"Every path is knowable in advance -- no dynamic reasoning needed.")
if all_paths_knowable and needs_llm_judgment_per_step:
return ArchitectureRecommendation(ArchitectureChoice.LLM_WORKFLOW,
"Structure is fixed, but individual steps need LLM judgment (e.g., classification).")
if needs_dynamic_multi_step_reasoning and needs_specialized_roles:
return ArchitectureRecommendation(ArchitectureChoice.MULTI_AGENT,
"needs dynamic reasoning AND distinct specialized roles.")
if needs_dynamic_multi_step_reasoning:
return ArchitectureRecommendation(ArchitectureChoice.AGENT,
"needs dynamic, multi-step reasoning with runtime decisions.")
return ArchitectureRecommendation(ArchitectureChoice.DETERMINISTIC_WORKFLOW,
"No dynamic reasoning need identified -- default to the simplest option.")
# Exactly Section 6's three real developer scenarios
r1 = recommend_architecture(all_paths_knowable=True, needs_llm_judgment_per_step=False,
needs_dynamic_multi_step_reasoning=False, needs_specialized_roles=False)
print(f"[{r1.choice.value}] {r1.rationale}")
r2 = recommend_architecture(all_paths_knowable=True, needs_llm_judgment_per_step=True,
needs_dynamic_multi_step_reasoning=False, needs_specialized_roles=False)
print(f"[{r2.choice.value}] {r2.rationale}")
r3 = recommend_architecture(all_paths_knowable=False, needs_llm_judgment_per_step=True,
needs_dynamic_multi_step_reasoning=True, needs_specialized_roles=False)
print(f"[{r3.choice.value}] {r3.rationale}")
Expected Output:
[deterministic_workflow] Every path is knowable in
advance -- no dynamic reasoning needed.
[llm_workflow] Structure is fixed, but individual steps
need LLM judgment (e.g., classification).
[agent] needs dynamic, multi-step reasoning with runtime
decisions.
What this confirms: All three features route to an appropriate architecture. The refund process remains deterministic, while ticket classification uses an LLM workflow rather than a full agent.
The unfamiliar billing investigation requires dynamic agent decisions. The example turns this module’s architecture spectrum into a repeatable decision tool.
10. Production Considerations
- Start with the LEAST autonomous option and escalate only when real, observed limitations demonstrate the need — not preemptively
- Document WHY a specific architecture was chosen for a given feature — this helps future maintainers understand whether escalating to more autonomy is warranted later
11. Trade-offs
- LLM workflows offer a useful middle ground — one point of judgment within an otherwise predictable structure — worth considering before jumping straight to a full agent
- An agent’s flexibility for unpredictable tasks comes at a real, measurable cost across every dimension in Section 3’s table
12. Chapter Summary
Architecture choice for an AI-involved task spans a spectrum from fully deterministic workflows through LLM workflows, agents, and multi-agent systems — and every dimension (reliability, cost, latency, control, debuggability) gets worse as autonomy increases.
This is precisely why your Agents course’s “least autonomous architecture that solves the problem” principle exists: autonomy is a real, deliberate trade for flexibility, not a free upgrade, and should be reached for only when a task’s unpredictability demands it.
13. Visual Cheat Sheet
Deterministic Workflow --> LLM Workflow --> Agent --> Multi-Agent
Reliability: HIGHEST -------------------------------> LOWEST
Cost: LOWEST --------------------------------> HIGHEST
Latency: FASTEST -------------------------------> SLOWEST
Control: FULLEST -------------------------------> LEAST
Debuggability: EASIEST ------------------------------> HARDEST
Use the LEAST autonomous point that solves the problem.
14. Top Takeaways
- The architecture spectrum runs from deterministic workflow through LLM workflow, agent, to multi-agent — with increasing autonomy at each step.
- Every engineering dimension (reliability, cost, latency, control, debuggability) worsens as autonomy increases.
- LLM workflows are a useful middle ground — a fixed structure with one point of LLM judgment, not full agentic autonomy.
- The plannability test — can every path be mapped in advance? — is the repeatable way to decide where on this spectrum a task belongs.
- “Use the least autonomous architecture that solves the problem” is a deliberate trade-off principle, not a limitation to work around.
15. Interview Questions
Q: 1. Explain why every engineering dimension (reliability, cost, latency, debuggability) worsens as you move from a deterministic workflow toward a full agent.**
Ans: A deterministic workflow has no LLM-driven unpredictability at all — every path is known, so it’s fast, cheap, and easy to debug. An LLM workflow introduces unpredictability only at specific, isolated judgment points. An agent introduces unpredictability across the ENTIRE control flow, since the system itself decides what happens next at runtime, requiring more LLM calls (cost, latency) and making the full reasoning trace necessary to debug any given outcome (debuggability).
Multi-agent compounds this further across multiple independently-reasoning components.
- Why it matters: This is the concrete, justification behind “least autonomous architecture” — it’s not a stylistic preference, it’s a real, measurable cost curve.
- Real-world example: Section 3’s comparison table.
- Common mistake: Treating autonomy as a strictly positive capability upgrade with no trade-off.
- Interviewer is testing: Whether the candidate understands autonomy as a deliberate, costly trade-off, not a free enhancement.
- Likely follow-up: “When does the trade-off favor more autonomy?” → When a task’s real unpredictability means a fixed workflow cannot handle the actual range of cases it needs to.
Q: 2. What is an LLM workflow, and why is it a useful middle option between a deterministic workflow and a full agent?**
Ans: An LLM workflow has a fixed sequence of steps — the overall structure and path are known in advance — but one or more individual steps use an LLM for judgment, like classifying a ticket’s urgency.
It’s useful because many real tasks have a predictable overall structure but need judgment-based decisions at specific points, and jumping straight to a full agent for these tasks would trade away reliability and control the task doesn’t actually require.
- Why it matters: Without this middle option, teams often incorrectly frame the choice as binary (workflow vs. agent), missing a better fit for many real tasks.
- Real-world example: Section 6’s ticket-classification example.
- Common mistake: Not recognizing that “uses an LLM” doesn’t automatically mean “needs to be an agent.”
- Interviewer is testing: Whether the candidate understands the full spectrum, not just the two extremes.
- Likely follow-up: “How would you identify whether a task fits an LLM workflow versus needing a full agent?” → Section 4’s plannability test — is the overall STRUCTURE fixed, with judgment needed only at specific points, versus needing dynamic, runtime decisions about what happens next at all.
16. Scenario-Based Question
Scenario: TechCorp’s engineering team builds a multi-agent system (researcher, coder, reviewer) for a feature that turns out, on reflection, to have a fully mappable decision tree — check inventory, check pricing rules, generate a quote. The system is slow, expensive, and hard to debug compared to what a simpler architecture would have produced.
- Problem Analysis: Section 8’s common mistake — reaching for the most autonomous, flexible architecture for a task that was fully plannable in advance.
- How to Think: This isn’t a bug to patch within the multi-agent system — it’s an upfront architecture mismatch that Section 4’s plannability test would have caught before implementation began.
- Investigation: Apply Section 4’s plannability test retroactively — can every path through “check inventory, check pricing, generate a quote” be mapped in advance? If yes, the multi-agent choice was unwarranted from the start.
- Root Cause: No architecture decision process was applied before implementation — the team defaulted to the most flexible, autonomous option without checking whether the task’s characteristics warranted it.
- Solution: Redesign as a deterministic (or, if any single step needs judgment, LLM) workflow — directly Section 6’s refund-approval example — recovering the reliability, cost, and debuggability Section 3’s table shows a deterministic approach provides.
- Trade-offs: The redesign requires, real engineering effort to rebuild — a real, avoidable cost of not applying Section 4’s test before the original implementation began.
- Production Considerations: This scenario directly demonstrates why Section 7 emphasizes starting with the LEAST autonomous option and escalating only when demonstrated — not the reverse.
17. Next Step
Next: Module 23 — Architecture Decision Making — closing Level 8: the complete, senior-engineer decision framework spanning scale, latency, cost, security, reliability, and team expertise, with decision matrices for real trade-offs.
- Author
- TechByteByByte Editorial Team
- Reviewed by
- TechByteByByte Admin
- Published
- Last reviewed