You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Target: ADK 2.0 (Beta) — enable Workflow in LlmAgent.sub_agents for conversation delegation.
Problem
ADK 2.0 only supports Workflow → Agent (via ctx.run_node()). The inverse — Agent → Workflow — is not possible. This forces an all-or-nothing adoption: either convert everything to workflows or lose deterministic pipelines.
Cost impact: Workflow-root loops generate 7 events/3 LLM calls for data gathering. Sub-agent delegation would reduce to 5 events/2 LLM calls (30% reduction via event compaction on Agent Runtime).
Proposed Solution
Allow Workflow as a sub-agent via delegation:
fromgoogle.adkimportLlmAgent, Workflowfromgoogle.adk.workflowimportnode@node(rerun_on_resume=True)asyncdefdata_collection_workflow(ctx, request):
amount=awaitctx.run_node(request_amount_node) # HITL via RequestInputdate=awaitctx.run_node(request_date_node)
return {"amount": amount, "date": date}
expense_agent=LlmAgent(
name="expense_agent",
instruction="Delegate to collect_data if fields missing.",
sub_agents=[
Workflow(name="collect_data", edges=[("START", data_collection_workflow)])
],
)
Benefits:
Conversation delegation with HITL support (RequestInput)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Workflow as Sub-Agent
Target: ADK 2.0 (Beta) — enable
WorkflowinLlmAgent.sub_agentsfor conversation delegation.Problem
ADK 2.0 only supports
Workflow → Agent(viactx.run_node()). The inverse —Agent → Workflow— is not possible. This forces an all-or-nothing adoption: either convert everything to workflows or lose deterministic pipelines.Cost impact: Workflow-root loops generate 7 events/3 LLM calls for data gathering. Sub-agent delegation would reduce to 5 events/2 LLM calls (30% reduction via event compaction on Agent Runtime).
Proposed Solution
Allow
Workflowas a sub-agent via delegation:Benefits:
RequestInput)Representative Examples
1. Guided Form Collection
Main agent identifies required fields; workflow deterministically collects each with validation.
2. Compliance Verification
Main agent prepares submission; workflow runs deterministic checks with human approval gates.
3. Multi-Step Configuration
Agent understands intent; workflow guides through deterministic setup with confirmation steps.
Comparison
bind_tools([graph])LangGraph allows graphs as callables. ADK needs equivalent:
Workflowas delegatable sub-agent.Considerations
Docs: Dynamic Workflows | Graph-based Workflows
Beta Was this translation helpful? Give feedback.
All reactions