Resources · n8n integration

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

Why automate

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.

Connect

How do you authenticate Gemini in n8n?

  1. 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.

  2. 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.

  3. 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.

Connections

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)

  • Modelai_languageModel
01ModelThis 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.

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.
Use cases
a support bot built on an agent, or a nightly chain that summarizes what landed in Google Sheets.
Parameters

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.

01

Model

modelName

What 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.
Use cases
start a chatbot on one model, then change this single field to try another on the same workflow. Since the list is account-driven, a name a colleague uses may simply not appear in your dropdown.
02

Maximum Number of Tokens

options.maxOutputTokens

What 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.
Use cases
a one-line classification label needs almost nothing, while a summary of a long document needs room to finish. Too low a ceiling and the answer stops mid-sentence, which looks like a model failure but is a setting.
03

Sampling Temperature

options.temperature

What 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.
Use cases
data extraction and routing want a value near zero, so two runs on the same input agree. Anything written for a human to read can afford more. Change this one first when answers feel either robotic or invented.
04

Top K

options.topK

What 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.
Use cases
reach for it when a model that already runs at a sensible temperature still slips in odd wording. Left at its default it does nothing at all, which is why most workflows never touch it.
05

Top P

options.topP

What 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.
Use cases
useful on a workflow that must stay close to its source text. Google's own guidance is to alter this or the temperature, not both, so pick one dial and leave the other alone rather than stacking two corrections.
06

Safety Settings

options.safetySettings

What 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_EXPLICIT and HARM_CATEGORY_DANGEROUS_CONTENT.
  • Safety Threshold: how strict the block is, from BLOCK_LOW_AND_ABOVE down to BLOCK_ONLY_HIGH, with BLOCK_NONE allowing all content and HARM_BLOCK_THRESHOLD_UNSPECIFIED leaving it unspecified.
Use cases
a public-facing bot tightens the harassment and hate speech categories, while a moderation workflow that has to read reported messages loosens them on purpose so the model does not refuse its own input.
Need help

Need help automating Google Gemini Chat Model with n8n?

A person reads every message.

FAQ

Questions builders ask next

01Is the n8n Google Gemini Chat Model node free?
Yes on the n8n side. The node belongs to the n8n AI package shipped with n8n, so there is nothing to install and nothing extra to pay, on n8n Cloud as well as on a self-hosted instance under the Community Edition and its Sustainable Use license. What you pay for is the model itself: Google charges its own API calls under its own terms, and n8n adds nothing on top of that. The one case where no Google account is involved is n8n Cloud with Gateway credits selected in the credential field, where the node runs without a key of your own.
02What do you need to make it run?
Two things. A credential, either the Google credential holding your API key or, on n8n Cloud, the Use Gateway credits option in the same field. And a root node to attach it to, because this node has no main input and never runs alone. Attach it to the Model port of an AI Agent, a Basic LLM Chain or any other root node listed for that port, then pick a value in the Model dropdown. If the dropdown stays empty, the credential is the thing to fix: n8n only lists the models your account is allowed to call.
03What are the limits of this node?
Three, all documented. There is no proxy support: the node uses Google's SDK, which ignores proxy configuration, and the workaround is a dedicated reverse proxy for Gemini requests with the credential's Host value pointing at it. The node has no main input, so it cannot sit in the middle of a workflow the way a regular node does. And this page describes version 1 of the node, the highest in the catalog; an older workflow may show an earlier version with fewer options. Beyond the 6 parameters listed here, everything else is decided by the root node.
04What is the minimum setup for a first AI workflow?
A root node, this sub-node, and a credential. Start with a Basic LLM Chain rather than an agent: one prompt goes in, one answer comes out, and there are no tools or memory to debug while you are still checking that the model answers at all. Attach Gemini to its Model port, leave every option untouched, and run it once. Once that works, move up to an AI Agent when the model needs to call tools, and only then start adjusting Sampling Temperature and Maximum Number of Tokens to match the job.
05n8n or Make for a Gemini workflow?
It depends on where the data has to live. Make is hosted, with no self-hosting option, and bills per operation, which suits a team that wants nothing to run and a predictable visual builder. n8n runs on your own server through Docker or npm, or on n8n Cloud, with the same workflow either way, so prompts and customer data can stay on infrastructure you control. The sub-node model also matters here: swapping Gemini for another provider is one node, not a rebuild. Pick on hosting, data control, cost model and how you like to build.
Hack'celeration Lab

Get our weekly integration tips.

No spam. Unsubscribe anytime.