Problem running webhook in production AI AGENT

Greetings to all.

I have come across an unusual problem.

I have a flow using AI AGENT, which in the test base works normally, when I put it into production it gives an error.

That’s my flow:

It works normally in test mode, when I activate the webhook in production it stops working.

I’ve analyzed the webhook and it works normally when I put it alone in another flow.

So, I realized that when I put google sheets in the tool option in AI AGENT, the flow doesn’t work.

When I remove the google sheets from the tool, it works again.

It seems to be a bug.

Sorry, I can’t post the flow, it has sensitive company data.

Thanks to everyone who can help!

Does webhook contains any details, that are used later on in the script where it is failing?
It seems that when webhook is being executed in Prod, it is not providing some details.

I have already added the webhook node alone in production mode and it works normally.

The most interesting thing is, when I remove the spreadsheets from Tool, everything works in production mode.

So on which node it is failing in Production?
Could you provide screenshot of execution?

n8n agent in test mode, everything works normally, but in production (via webhook) the following error occurs:

Code Cannot read properties of undefined (reading ‘supplyData’)

I’ve noticed that the error only occurs when I add the spreadsheet (Google Sheets Tool) as an AI Agent tool. If I remove the spreadsheet, the flow runs normally in production.

From what I’ve researched and tested, the n8n AI Agent expects each tool to return data in a specific format, containing the supplyData property.

However, the Google Sheets Tool node doesn’t return the data in this format automatically, and n8n doesn’t allow you to add a node Function or other visual processing between the Sheets Tool and the AI Agent to adjust the structure of the data.

Because of this limitation, I am unable to adapt the spreadsheet output to the format expected by the Agent, always resulting in this supplyData error in production.

If anyone has experienced this or knows of a practical solution for this scenario, I would really appreciate any advice!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.