Repository navigation
to_a2a(Workflow) fails when Workflow contains LlmAgent with input_schema/output_schema (ADK 2.0.0b1) #5487
Description
Activity
- addedworkflow[Component] This issue is related to ADKworkflow[Component] This issue is related to ADKworkflow
on Apr 25, 2026 Hi @gorgonline , Thanks for reporting this.
We have tested this out onADK 2.0.0b1and can confirm that passing aWorkflowdirectly intoto_a2a()currently throws an error. Regarding the workaround of wrapping theWorkflowinside anLlmAgent'ssub_agents, it appears this triggers a strict PydanticValidationErrorin standard environments.
Workaround:
the safest workaround if you need A2A right now is to serve the LlmAgent directly rather than placing it in a single-step 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, ) # Pass the agent directly to A2A app = to_a2a(writer) root_agent = writerHey @gorgonline! We don't support converting Workflows to a2a apps just yet, but we're working on it. In the meantime, the workaround you and @sanketpatil06 suggested is the best way to go!
- addeda2a[Component] This issue is related a2a support inside ADK.[Component] This issue is related a2a support inside ADK.
on Apr 30, 2026 Hi — just a heads-up that this still reproduces on the GA release
google-adk==2.0.0.I checked the v2.0.0 sources:
agent_card_builder.py @ v2.0.0:AgentCardBuilder.__init__(*, agent: BaseAgent, ...)— still typed toBaseAgent, noWorkflowbranch.agent_to_a2a.py @ v2.0.0:def to_a2a(agent: BaseAgent, ...)— same signature, noWorkflowsupport.
PR #5710 was closed without merging and I don't see a replacement in v2.0.0. Both original bugs still occur (
AgentCardBuilderfails on missingsub_agents; Workflow events never reach the A2A client).The
LlmAgent-wrapper workaround from the original report still works on 2.0.0, so this isn't blocking us — flagging in caseto_a2a(Workflow)is intended to be supported at GA.Thanks!
- added a commit that references this issue
on Jun 2, 2026 - added a commit that references this issue
on Aug 11, 2026
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)