AI agents are good at deciding what to do next, but that does not mean every workflow should be controlled entirely by an AI model.
In a production application, some steps are predictable.
A request may need to go through validation, data retrieval, policy checks, approval, and notification. Some of those steps can run in parallel. Others must happen in a specific order. Some decisions should be made by code rather than a language model.
This is where graph-based workflows become useful.
Google's Agent Development Kit, commonly called ADK, now provides workflow capabilities for building explicit execution paths using nodes, edges, routing, parallel execution, joins, and human-in-the-loop steps. ADK is designed to support everything from simple agents to more structured multi-agent workflows.
The important question is not whether graph workflows are powerful.
It is:
When should an AI application use a graph instead of letting an agent decide the entire workflow?
What Is a Graph Workflow?
A graph workflow represents an application process as a collection of steps connected by defined paths.
A simplified workflow might look like this:
START
|
v
Validate Request
|
v
Fetch Data
|
v
Analyze
|
v
Decision
|
+----------+
| |
v v
Approve Review
| |
+----+-----+
|
v
Response
|
v
ENDEach box represents work.
The connections represent what can happen next.
This is different from giving an agent a large instruction such as:
"Handle this request and do whatever is necessary."With a graph, the developer explicitly defines important parts of the execution model.
ADK's workflow capabilities support patterns such as sequential execution, parallel work, routing, joining results, human review, and dynamic orchestration.
Why Use a Graph for an AI Agent?
A language model is useful when the problem involves interpretation.
For example:
"What is the customer actually asking for?"A model can classify the intent.
But consider this rule:
If order age > 30 days:
deny refundThere is little reason to ask an LLM to make that decision.
A better architecture is:
LLM
|
+-- Understand customer request
|
v
Application Code
|
+-- Apply refund policy
|
v
LLM
|
+-- Explain decisionThis separates probabilistic reasoning from deterministic business logic.
That separation is one of the strongest reasons to consider a graph workflow.
Agent vs Graph Workflow
A single agent can be enough for simple tasks.
User
|
v
Agent
|
+-- Tool
+-- Tool
+-- Tool
|
v
ResponseThe model decides which tool to use and when.
A graph provides more control:
User
|
v
Router
|
+-------> Agent A
|
+-------> Agent B
|
+-------> Human Review
|
v
Final ResponseThe difference is not simply visual.
It changes who controls execution.
Approach | Main Decision Maker | Best For |
|---|---|---|
Single agent | Model | Open-ended tasks |
Sequential workflow | Workflow | Predictable pipelines |
Parallel workflow | Workflow | Independent tasks |
Deterministic router | Code | Explicit business rules |
Agent router | Model | Semantic classification |
Dynamic workflow | Application code | Runtime-generated work |
Human-in-the-loop | Person | Sensitive decisions |
ADK supports these different orchestration patterns rather than forcing every problem into one agent model.
Start With the Simplest Possible Architecture
A common mistake in agent engineering is introducing a graph too early.
Suppose your application does this:
User Question
|
v
Agent
|
+-- Search Tool
|
+-- Calculator Tool
|
+-- Database Tool
|
v
AnswerYou may not need a graph.
The agent can select the appropriate tool based on the user's request.
Graph orchestration becomes more useful when the process has explicit structure.
For example:
Receive Request
|
v
Validate Identity
|
v
Fetch Account
|
+------+
| |
v v
Billing Activity
| |
+------+
|
v
Policy
|
+----+----+
| |
v v
Approve Human ReviewNow the workflow itself is meaningful.
Sequential Workflows
The simplest graph pattern is sequential execution.
A
|
v
B
|
v
C
|
v
DEach step depends on the previous step.
For example, a document-processing system might use:
Upload Document
|
v
Extract Text
|
v
Classify Document
|
v
Extract Fields
|
v
Validate Fields
|
v
Store ResultThere is no reason to execute the validation before field extraction.
The dependency is explicit.
When Sequential Execution Makes Sense
Use sequential execution when:
Step B requires the result of step A.
The order is part of the business process.
Each stage transforms the previous stage's output.
You want predictable execution.
It is especially useful when debugging because you can identify exactly which stage failed.
Parallel Workflows
Not every operation needs to wait for another.
Imagine a support request that requires:
Order History
Payment History
Customer HistoryAll three can use the same customer or order identifier.
There is no reason to execute them one after another.
Instead:
+--> Order History
|
Request -----+--> Payment History
|
+--> Customer History
|
v
Combine
|
v
DecideThis is commonly called fan-out and fan-in.
ADK's graph workflow model supports parallel execution followed by a join operation that waits for the required results.
Why Parallelism Matters
Suppose three services each take approximately one second.
Sequential execution:
1s + 1s + 1s = approximately 3sParallel execution:
max(1s, 1s, 1s) = approximately 1sThese are simplified examples rather than production benchmarks.
The real benefit depends on network latency, service behavior, concurrency limits, and workload characteristics.
The architectural point is more important:
If independent operations do not need to wait for each other, a workflow should not necessarily serialize them.
Fan-In With a Join
Parallel execution creates another problem.
Once the three operations finish, something needs to combine their results.
Order --------+
|
Payment ------+----> Join ----> Decision
|
Customer -----+A join node provides a clear synchronization point.
For example:
results = {
"order": order_result,
"payment": payment_result,
"customer": customer_result
}The decision stage can then consume the combined data.
This is much easier to reason about than having several agents independently update shared state.
Deterministic Routing
Some decisions should be made using normal application code.
Consider:
Refund Amount < $50
AND
No Chargeback
AND
Refund Count < 3This is a business rule.
A simple function is appropriate:
def refund_policy(amount, chargeback_open, previous_refunds):
if chargeback_open:
return "DENY"
if amount < 50 and previous_refunds < 3:
return "AUTO_APPROVE"
return "MANUAL_REVIEW"The output can determine the next graph path.
Policy
|
+---------+---------+
| | |
v v v
Approve Deny ReviewThis approach has several advantages.
The rule is:
Testable
Reviewable
Deterministic
Version controlled
Easy to audit
You do not need an LLM to determine whether amount < 50.
Agent-Based Routing
Other routing problems are semantic.
Suppose a support system receives:
"My shoes are too small. Can you send me another pair?"The application needs to understand that this is probably an exchange request.
Another user may say:
"I don't want the shoes anymore. Please give me my money back."That is likely a refund request.
A model can classify these requests.
Customer Message
|
v
Intent Agent
|
+-----+------+-------+
| | |
v v v
Refund Exchange ClarifyThe important distinction is:
The model chooses the meaning. The graph defines the possible destinations.
Join the conversation! Your thoughts help the community grow.