Skip to content

Workflow output_schema is dropped when exposed via to_a2a(); artifact contains only the last agent node's text output #6762

Description

@Jausk

🔴 Required Information

Describe the Bug:
A Workflow with a declared output_schema returns the correct typed object when executed with InMemoryRunner, but when the same workflow is exposed via to_a2a() the resulting A2A artifact contains only the text output of the last LlmAgent node that ran. The workflow's actual return value is discarded.

Steps to Reproduce:
Please provide a numbered list of steps to reproduce the behavior:

  1. Define a dynamic workflow whose node returns a Pydantic model with several fields. The first 2 agent's node returned pydantic BaseModel, while the last node returned a str. The final output is built by taking the outputs of different agents via RemoteA2aAgent (2 classes, 1 str)
  2. Set output_schema on the Workflow.
  3. Run it via InMemoryRunner / Expose it through FastAPI → the emitted event contains the full model.
  4. Expose the same workflow with to_a2a() and call it via JSON-RPC message/send → result.artifacts contains only the last agent's text (str). The other fields appear as separate text fragments in result.history, but not in the artifact key itself.

Expected Behavior:
The artifact should contain the workflow's return value, validated against output_schema.

Observed Behavior:
The artifact only contained the output of the last Agent that was invoked by using ctx.run_node. No matter what the output returned by means of Event(output=...)

Environment Details:

  • ADK Library Version (google-adk[extensions]) 2.6.3
  • A2A SDK: 1.1.2
  • Desktop OS:** [e.g., macOS, Linux, Windows]: WSL 2
  • Python Version (python -V): 3.14.4

Model Information:

  • Are you using LiteLLM: Yes, the agents use LiteLLM to connect to the AI Gateway.
  • Which model is being used: (e.g., gemini-2.5-pro): qwen3.5:4B / gemma4:e4b

🟡 Optional Information

How often has this issue occurred?:

  • Always (100%). Stops happening when I remove the last ctx.run_node (the one returning the str)

Metadata

Metadata

Labels

a2a[Component] This issue is related a2a support inside ADK.request clarification[Status] The maintainer need clarification or more information from the author

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions