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.
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!