Environment
google-adk==2.0.0b1
- Python 3.13, macOS
Description
Calling to_a2a(workflow) on a Workflow whose nodes include an LlmAgent with input_schema or output_schema fails in two distinct ways:
Bug 1 — AgentCardBuilder requires sub_agents on Workflow.
AgentCardBuilder accesses Workflow.sub_agents, a BaseAgent field not exposed by Workflow. This raises RuntimeError on agent-card construction.
Bug 2 — Event converter cannot map Workflow events to A2A message parts.
If AgentCard is supplied manually (bypassing Bug 1), the A2A event converter does not translate Workflow node events into A2A message parts. The task stays in working state forever; the client never gets a final response.
Repro
from google.adk.workflow import Workflow
from google.adk.agents import LlmAgent
from google.adk.a2a.utils.agent_to_a2a import to_a2a
from pydantic import BaseModel
class Out(BaseModel):
text: str
writer = LlmAgent(
name="writer",
model="gemini-2.5-flash",
instruction="Write a short reply.",
output_schema=Out,
)
wf = Workflow(name="pipe", edges=[("START", writer)])
app = to_a2a(wf) # RuntimeError from AgentCardBuilder
Workaround
Wrap the Workflow in an LlmAgent:
wrapper = LlmAgent(
name="pipe_a2a",
model="gemini-2.5-flash",
instruction="Delegate to the workflow.",
sub_agents=[wf],
)
app = to_a2a(wrapper)
This avoids both bugs but adds an extra LlmAgent layer plus an extra LLM call per request. Schema-less Workflows work directly with to_a2a and do not need this wrapper.
Expected behavior
to_a2a(Workflow) should serve any Workflow — with or without schemas — as a first-class A2A agent, without requiring an LlmAgent wrapper.
Related
Environment
google-adk==2.0.0b1Description
Calling
to_a2a(workflow)on aWorkflowwhose nodes include anLlmAgentwithinput_schemaoroutput_schemafails in two distinct ways:Bug 1 —
AgentCardBuilderrequiressub_agentson Workflow.AgentCardBuilderaccessesWorkflow.sub_agents, aBaseAgentfield not exposed byWorkflow. This raisesRuntimeErroron agent-card construction.Bug 2 — Event converter cannot map Workflow events to A2A message parts.
If
AgentCardis supplied manually (bypassing Bug 1), the A2A event converter does not translate Workflow node events into A2Amessageparts. The task stays inworkingstate forever; the client never gets a final response.Repro
Workaround
Wrap the Workflow in an
LlmAgent:This avoids both bugs but adds an extra
LlmAgentlayer plus an extra LLM call per request. Schema-less Workflows work directly withto_a2aand do not need this wrapper.Expected behavior
to_a2a(Workflow)should serve any Workflow — with or without schemas — as a first-class A2A agent, without requiring anLlmAgentwrapper.Related
sub_agentssupport in A2A Remote Agents (same wrapper-redundancy theme from the consumer side)working(possibly same root cause as Bug 2 here)