I am building a workflow using Gemini Chat Model node in n8n. It is erroring out with below error [GoogleGenerativeAI Error]: Error fetching fromhttps://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: fetch failed
When checking Google AI studio the response has been generated. The node runs for 35-40 mins before erroring. Total input token ~25k only using 2.5 pro and pro 3 preview.
Please share if you have faced this error before.
Hey @Saumya_Singh !
The connection from your n8n to Google is being droppped or timed out by some network compoonent (firewall, proxy, load ballancer, or hosting provider) after a long‑runnin requuest.
If you try with with less tokens happens the same?
input token is around ~25k much less than gemini limit. I am not able to provide response time limit in gemini node which is generally there in open ai node to increase time.
Ok… is either a connection problem or the node itself.
Try the HTTP node instead and see if you get same error .
Paste this curl command into a HTTP node(top-right you have a button “import curl”).
curl “https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent?key=YOUR_API_KEY”
-H “Content-Type: application/json”
-X POST
-d ‘{
“contents”: [
{
“role”: “user”,
“parts”: [
{
“text”: “What is the key to solving network fetch errors in n8n for the Gemini API?”
}
]
}
],
“config”: {
“temperature”: 0.1
}
}’