I am building this workflow for the past 3 days, I am a beginner, dont know how to code. The idea is to get latest blog posts from 5 websites and use that content to generate an email using Gemini.
I am stuck at the HTTP Node to call Gemini. I just cant get the response from Gemini. Everytime there is a new error that I dont know how to solve.
Take a look at the screenshots for better context.
If anyone know how to solve this, please I need your help!
You didn’t include the error. But there is a small part visible: You exceeded...
This tells us that the issue isn’t authentication or connection, but about the service. Try sending a small body, with text like Hello!and see if it succeeds. Maybe you are sending a body that is too big and exceeds prompt limit.
Another reason could be that you got rate-limited. Too much requests in a small amount of time will temporarily block you.
Note: Please delete the second SS. You exposed your key.
Also, n8n already has official Gemini nodes:
The error in the screenshot that you see is definitly the exceeding requests one. The previous ones were 404 or other sorts.
And you said it already has Gemini nodes, to generate a text, will we use “Message a model”?
Hi,
The issue is in how you’re formatting the data within your HTTP Request node. You are sending a stringified JSON object inside your prompt, which the Gemini API cannot process correctly.
The API expects a clean, readable text string containing the article data, not a raw JSON string.
The Solution
{{
JSON.stringify({
"contents": [{
"parts": [{
"text": "You are an expert entertainment newsletter writer. Using the data below, write a short, fun, friendly newsletter email for subscribers. Add a subject line.\n\n" + $json.articles.map(article => `Title: ${article.title}\nSnippet: ${article.snippet}\nLink: ${article.link}`).join('\n\n---\n\n')
}]
}]
})
}}
What this code does:
Instead of just inserting the raw JSON, this expression correctly loops through each article (map), formats the title, snippet, and link into a clean text format, and then joins them all together into a single block of text (join). This is the format the Gemini API understands, and it should solve the error.
Wow, thank you very much. I am using a Gemini model now directly which I didnt know existed inside n8n.
Its just that I am not a coder so for me to understand what language of JSON will Gemini understand is a bit complex. What sources would you recommend for a complete beginner to go to to understand these JSON strucures that LLMs can read etc?
I recommend attending n8n’s text courses. It’s a good start to learn basic workflow structure, essential nodes etc.
@Hassan2 instead exposing API key , use Header Auth in Authentication.



