I have the same error message/problem when using AI Agent (Tools Agent) with Google Gemini Chat Model, co-operating with Vector Store Tool (with supabase db), no mater gemini-1.5-flash or 2.0-flash. It always shows Error in sub-node ‘Google Gemini Chat Model‘
I’m having the same issue here too. The cause seems to be that, if you check the logs, you can see that the AI response is not being registered properly in the memory variables.
I’m trying to fix it through prompting. Have you already found a solution?
Gemini models tend to follow the system prompt very strictly, so you need to reinforce the use of n8n’s built-in format_final_response function to ensure it correctly stores the variables at the end.
Add this snippet in your chatInput and let me know the result → “REMEMBER TO ALWAYS USE format_final_response at the end of every response.”
Main problem I guess parsing the response from Gemini. In this example I was trying to get JSON format result. But Gemini returns with extra symbols and text. Check the topic for more detail. If you place JS code that parse the gemini response like this example, I can record every json data to google sheets with mapping.
If my reply solves your problem, please remember to mark it as a solution.
After struggling with this issue, I finally figured it out! When you add a tool (like Google Docs) to your AI agent in n8n, the Google Gemini Chat Model requires at least one dynamic parameter to function properly. That means you need to define an input field using the $fromAI() function so that Gemini can dynamically generate values during execution.
But here’s the catch—tool naming matters a lot! If your tool’s name has spaces or special characters, Gemini won’t recognize it properly. It treats the tool as a function, and function names need to follow strict rules.