AI Agent node is using Gemini Chat Model but its not able to connect to Gemini API.
Running n8n from Docker. The Gemini API is whitelisted in my corporate proxy. I have verified the connectivity to Gemini through a curl command from the Linux VM and also from the n8n Docker container and it was successful.
I was able to successfully connect to Gemini API using HTTP request node. Only when I’m using Gemini Chat Model, its failing.
Even in Gemini Chat Model, I could see the models getting listed in the drop down. However when I try to send any message to the Gemini, its getting failed with below error
[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent: fetch failed
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{
"nodes": [
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.4,
"position": [
0,
0
],
"id": "183627e4-3c09-4445-8a39-3428063086ed",
"name": "When chat message received",
"webhookId": "82d96c60-519b-464c-a6ce-dce7046c2915"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3.1,
"position": [
208,
0
],
"id": "1df4b91c-99b4-4fd0-9342-92ba9adc6fc8",
"name": "AI Agent"
},
{
"parameters": {
"modelName": "models/gemini-3-pro-preview",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"typeVersion": 1,
"position": [
80,
208
],
"id": "c3f7f981-cd47-45d3-8563-c44a2d4d86ac",
"name": "Google Gemini Chat Model",
"credentials": {
"googlePalmApi": {
"id": "jtmGuD2hLva7mJNZ",
"name": "Google Gemini(PaLM) Api account"
}
}
}
],
"connections": {
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "889989dff0cc28a2a74fa69dc3303ab2c09b7734fbc341246a13aa5048f159c0"
}
}
Share the output returned by the last node
[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-preview:generateContent: fetch failed
Information on your n8n setup
- n8n version: 2.1.5
- Database (default: SQLite): default
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: RHEL 7




