- Home
- Resources
- Integrations
- Google Gemini Chat Model
n8n Google Gemini Chat Model nodeConfigure Google Gemini Chat Model in n8n.
Gemini only answers inside n8n once something is wired to it. The n8n Google Gemini Chat Model node is a sub-node, a small node that plugs into a bigger one instead of running on its own. It carries 6 parameters, from the model list to safety filters, and feeds any root node that accepts a language model.
Verified Trustpilot reviews · AI, automation & growth agency
What does the n8n Google Gemini Chat Model node actually do?
It hands a Gemini chat model to another node. On its own it produces nothing: it has no main input, it never appears alone in an execution, and it only comes to life through the port it is attached to. Think of it as the brain you screw onto an agent or a chain. The node holds the model choice and the sampling settings, while the root node holds the prompt, the data and the logic around it.
The first scenario is the one most builders land on. A chat trigger collects a customer question, an agent decides whether to look something up, and Gemini writes the reply that goes back out. The agent owns the instructions, this node owns how the answer is generated: which Gemini model, how long the answer runs through Maximum Number of Tokens, how loose the wording gets through Sampling Temperature. Swap the model in the dropdown and the same workflow behaves differently, with nothing else touched.
The second one is quieter and runs in the background. Documents land in a folder, a chain splits them, and a question-answering step uses Gemini to turn retrieved passages into a readable answer. Here the settings matter for a different reason: a long source document needs room in the output, and a factual answer wants a low temperature so two runs on the same passage read the same way.
The third one is classification. A support inbox or a form feed gets sorted before it reaches a human, and the model returns a label rather than prose. That job wants short completions, a temperature near zero and, when the incoming text comes from the public, Safety Settings tuned on purpose instead of left at whatever the account defaults to. In every case the value flowing in comes from the previous node through an expression, the {{ $json.field }} syntax n8n uses to read a field of the incoming item.
When should another node do the job? If the account you bill against belongs to another provider, attach that provider's chat model instead and keep the rest of the workflow identical, the same way the OpenAI node covers its own catalog. If the task needs a strict shape rather than free text, keep Gemini but let an Auto-fixing Output Parser sit between the model and the rest. And if the model is meant to drive tools rather than answer once, the root node is an AI Agent, or an AI Agent Tool when that agent is itself called by another agent.
Two limits are worth knowing before production. The node relies on Google's own SDK, which has no proxy configuration: a network that forces traffic through a proxy needs a dedicated reverse proxy for Gemini requests, with the Host value of the credential pointed at it. And billing stays with Google, which charges its own API calls under its own terms while n8n adds nothing on top. More on how the platform behaves day to day in the n8n review.
How do you authenticate Gemini in n8n?
- 01
Open the credential field on the node
Drop the node onto the canvas and open its credential field. A credential in n8n is a stored set of secrets that lives outside the workflow, so it gets created once and reused everywhere. On n8n Cloud there is a second route in that same field: pick Use Gateway credits and the node runs without a Google account at all, which is the fastest way to test whether the model fits before any key exists.
- 02
Create the Google credential with your API key
For a self-hosted instance, or a Cloud workflow that should bill against your own Google account, create the Google AI credential and paste the API key from your Google account. The credential also exposes a Host value, which normally stays as it is. Save it once and every workflow on the instance can select it from the same list, including workflows built by someone else on the team.
- 03
Pick a model and confirm the list loads
Back on the node, open Model. n8n queries the Google Gemini API live and shows only the models your account is allowed to call, so a populated dropdown is proof the credential works. An empty list means the key or the account is the problem, not the workflow. Pick a model, then attach the node to a root node and run the workflow once to see a real completion.
Where does this sub-node plug in?
n8n splits AI work in two: a root node receives the workflow items and does the reasoning, and sub-nodes plug into its ports, one type of sub-node per port. This node fills exactly one of those ports.
Output (what it plugs into)
- Model
ai_languageModel
01Model
This is the language model port. It is the socket a root node exposes when it needs something to generate text, and dragging from this node's connector onto it is enough: from then on, the root node runs every completion through Gemini.
Key parameters
- Required: a root node with this port does nothing until a chat model is attached to it.
- AI Agent and AI Agent Tool: the usual pair when the model has to choose between tools before answering.
- Basic LLM Chain and Question and Answer Chain: the simplest starting points, one prompt in, one answer out.
- Summarization Chain, Text Classifier and Sentiment Analysis: task-shaped root nodes with no prompt to write.
Which parameters are worth changing?
The Google Gemini Chat Model node has 6 parameters. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.
Parameters index
Model
modelNameWhat you see in n8n
Notes & use cases
Chooses which Gemini model generates the completion. n8n loads the list dynamically from the Google Gemini API, so the dropdown reflects what your account can actually call rather than a hardcoded catalog.
Key parameters
- Model: the model that will generate the completion, selected from the list n8n fetches at edit time.
Maximum Number of Tokens
options.maxOutputTokensWhat you see in n8n
Notes & use cases
Caps how much the model writes. A token is a fragment of text, roughly a short word, and this value sets the maximum number of them generated in the completion, which in practice sets the answer length.
Key parameters
- Maximum Number of Tokens: the ceiling for the completion, entered as a number.
Sampling Temperature
options.temperatureWhat you see in n8n
Notes & use cases
Controls randomness. Lowering it makes completions less random, and as the temperature approaches zero the model becomes deterministic and repetitive. Raised, sampling gets more diverse, with a higher risk of hallucinations.
Key parameters
- Sampling Temperature: the randomness dial for the sampling process, entered as a number.
Top K
options.topKWhat you see in n8n
Notes & use cases
Trims the long tail. It sets how many token choices the model considers for the next token, which removes low probability responses before they can be picked. It defaults to -1, and that value disables it.
Key parameters
- Top K: the number of token choices used to generate the next token, entered as a number.
Top P
options.topPWhat you see in n8n
Notes & use cases
Sets the probability the completion should use, through nucleus sampling: a value of 0.5 means half of all likelihood-weighted options are considered. A lower value ignores the less probable options.
Key parameters
- Top P: the probability mass the model samples from, entered as a number.
Safety Settings
options.safetySettingsWhat you see in n8n
Notes & use cases
Gemini ships adjustable content filters, and this collection is where they get set. Each entry pairs a category of harmful content with the threshold above which the model blocks it, and several entries can coexist.
Key parameters
- Safety Category: the category of harmful content to block, among
HARM_CATEGORY_HARASSMENT,HARM_CATEGORY_HATE_SPEECH,HARM_CATEGORY_SEXUALLY_EXPLICITandHARM_CATEGORY_DANGEROUS_CONTENT. - Safety Threshold: how strict the block is, from
BLOCK_LOW_AND_ABOVEdown toBLOCK_ONLY_HIGH, withBLOCK_NONEallowing all content andHARM_BLOCK_THRESHOLD_UNSPECIFIEDleaving it unspecified.
Need help automating Google Gemini Chat Model with n8n?
A person reads every message.
Questions builders ask next
01Is the n8n Google Gemini Chat Model node free?
02What do you need to make it run?
03What are the limits of this node?
04What is the minimum setup for a first AI workflow?
05n8n or Make for a Gemini workflow?
Get our weekly integration tips.
No spam. Unsubscribe anytime.


