Google Gemini 2.0 Flash - EXP

Describe the problem/error/question: I always get the error message below as soon as I add the google sheet to my tools.

What is the error message (if any)? Error in sub-node ‘Google Gemini Chat Model‘[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp:streamGenerateContent?alt=sse: [400 Bad Request] * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties: should be non-empty for OBJECT type

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

{
  "nodes": [
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1O8KwKfEfsJqTc1viraYpRKXUgQ_pgM09FD1vbx9wVtg",
          "mode": "list",
          "cachedResultName": "Tax Senior 1/24",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1O8KwKfEfsJqTc1viraYpRKXUgQ_pgM09FD1vbx9wVtg/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Tax Senior",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1O8KwKfEfsJqTc1viraYpRKXUgQ_pgM09FD1vbx9wVtg/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        380,
        220
      ],
      "id": "3deef61f-27d1-499a-b2f3-9dc10044bf11",
      "name": "Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "RlCaOlzBnyYEiL1h",
          "name": "Google Sheets account"
        }
      }
    }
  ],
  "connections": {
    "Google Sheets": {
      "ai_tool": [
        []
      ]
    }
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "0643254fd005f070c867d35e2279001046b1190311a66f1b2c5d9ba515984615"
  }
}

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

i am having the same issue

Me 3, im getting that this is an issue with Gemini and the way n8n handles function calling not being compatible atm.

1 Like

Same issue.
Running n8n locally and I did try all the Google Gemini Chat Models, none of them seem to work with the same message.

Runing latest .3 version, hoping for a resolution soon.

Did reattempt with a Basic LLM Chain, seems to work. As superfred mentioned, this is issue with the function calling, aka AI Agent using tools.

Same here, tool is not working with mistral, azure openapi (S0 pricing) as well

Same issue, not working for Agent. The problem was when I add a second property to the schema.

This was ok:

{
"type": "object",
"properties": {
	"id": {
		"type": "string",
		"description": "database id"
		}
	}
}

This not:

{
"type": "object",
"properties": {
	"id": {
		"type": "string",
		"description": "database id"
		},
  	"filter": {
		"type": "object",
		"description": "filter for querying Notion database pages, based on conditions"
		}
	}
}

@Jon Could the team have a look?