NewAgentNodeTyped does not constrain model's output in prompt
Author: zweizeichenCreated Sep 14, 2026Updated Sep 18, 2026
Labelsbug
Describe the Bug:
NewAgentNodeTyped does not instruct the model to adhere to the output schema: The docs state that manual definition of schemas for workflow nodes defined with NewAgentNodeTyped is not needed. Normally, this is handled by outputSchemaRequestProcessor when defining the output schema (genai.Schema !) on the Agent. As Agent.State.OutputSchema is nil unless manually defined, the instructions won't be added to the prompt and the response won't be structured.
Steps to Reproduce:
- Check out the example from the docs: https://adk.dev/graphs/data-handling/#constrain-node-data-with-schemas
- Observe the model instructions do not contain the desired output schema.
Expected Behavior: Instruct the model to adhere to the output schema.
Observed Behavior: The model just replied in an unstructured format which led to a parsing error.
Environment Details:
- ADK Library Version: 2.4.0
- Go Version: 1.26.7
Model Information: N/A
Source: google/adk-go