Agent node failing with "input_value='key not found"

What I Need Help With

All my chatflows were functioning normally, and suddenly the Agent node (FunctionCalling strategy) started failing consistently.

Every execution now breaks with the following error:

Failed to transform agent message:
req_id: 117bd56e42 PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for dict[str,any]\n Invalid JSON: expected value at line 1 column 1 [type=json_invalid, input_value='key not found', input_type=str]\n For further information visit https://errors.pydantic.dev/2.12/v/json_invalid"}

This happens consistently across different chatflows and is not related to any specific prompt or tool logic.


:magnifying_glass_tilted_left: Environment Details

  • Dify Version: 1.12.1

  • Deployment Type: Dify Cloud

  • Models Used: GPT-4.1, GPT-4.1 Mini

  • Agent Strategy: FunctionCalling


:repeat_button: Steps to Reproduce

  1. Create a chatflow with an Agent node.

  2. Configure the Agent to use:

    • FunctionCalling strategy

    • GPT-4.1 or GPT-4.1 Mini

  3. Send any message to the agent.


:white_check_mark: Expected Behavior

The Agent node should process the message normally and return a valid response.


:cross_mark: Actual Behavior

The Agent node fails immediately with a PluginInvokeError related to a ValidationError, indicating:

Invalid JSON: expected value at line 1 column 1
input_value='key not found'

The error suggests that the tool invocation result is being interpreted as invalid JSON.

:pushpin: Project Details

  • Project Type: Chatflow

  • Environment: Dify Cloud

  • Plan: Pro

  • Scope: Multiple chatflows affected

  • Impact: Blocking normal agent execution

@Zendesk_Dify_Bot fo

:white_check_mark: New Ticket Created

Duplicate of Agent node intermittently fails with "key not found" PluginInvokeError (ValidationError) · Issue #32266 · langgenius/dify · GitHub
Fixed.