Skip to content

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

Closed

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)

Activity

  1. a2105z commented on Aug 17, 2026

    @a2105z
    Contributor

    Let me try to take a stab at this - going to reproduce the error and open a PR - nobody else take this.

  2. a2105z commented on Aug 17, 2026

    @a2105z
    Contributor

    Opened a fix — see the linked PR.

    Root cause: A2A converters only looked at event.content.parts, while Workflow output_schema finals are emitted as Event(output=...) with empty content — so to_a2a() kept the last agent text as the artifact. The PR serializes Event.output into DataParts when content is absent.

    @Jausk if you can try the PR branch against your setup that would be helpful. @surajksharma07 for triage visibility.

  3. a2105z commented on Aug 17, 2026

    @a2105z
    Contributor

    PR: #6777

  4. added 3 commits that reference this issue on Aug 17, 2026
    35e3efd
    5712367
    366b518
  5. added
    a2a
    on Aug 18, 2026
  6. surajksharma07 commented on Aug 19, 2026

    @surajksharma07
    Collaborator

    @Jausk Dug into this and it lines up with what a2105z found in #6777. The A2A converters only ever read event.content so a Workflow's output_schema result (which comes through as Event.output with no content) just gets skipped. Patched it the same way locally (map Event.output to a DataPart when content's empty) and it holds up in our tests.
    Could you pull that branch and run it against your actual node setup to confirm?
    If it checks out please put it through a solid test pass before raising a separate PR since #6777 already covers this fix.

  7. added
    request clarification
    on Aug 19, 2026
  8. Jausk commented on Aug 19, 2026

    @Jausk
    Author

    I can confirm that, after cloning the PR branch, the issue is fixed. Artifact now returns the entire data structure. Thank you all for your efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

a2arequest clarification

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions