Connecting Google Gemini to n8n: API key, Chat Model node and multimodality
Published 28 July 2026 · 8 min read
In the landscape of LLMs you can wire into n8n, Google Gemini holds a distinctive spot: a natively multimodal model family (text, image, audio, PDF), one of the largest context windows on the market, and a deliberately simple entry point through Google AI Studio — a free API key to get started, with no Google Cloud setup. For automation workflows that need to analyze large documents, screenshots or audio recordings, it's a serious contender next to Claude and GPT or Mistral. Good news: n8n integrates Gemini natively through the Google Gemini Chat Model node. This guide covers creating the API key, wiring it into your workflows, choosing between the Flash and Pro families, and production best practices.
Why Gemini earns its place in your workflows
Three arguments come up regularly when a team picks Gemini for its automations:
- Native multimodality: Gemini isn't a text model with vision bolted on afterwards. The technical report published by Google's Gemini Team in 2023, "Gemini: A Family of Highly Capable Multimodal Models" (see on Google Scholar), describes a model family trained from the ground up across multiple modalities — text, image, audio, video. Concretely, for an n8n workflow, this means sending a scanned invoice, a screenshot or an audio recording to the same model that writes the reply, without stacking an OCR service, a transcription service and an LLM.
- A very large context window: Gemini models accept particularly long inputs. Analyzing a full contract, a long conversation history or several documents at once becomes possible without prior splitting — which simplifies some workflows where other models force careful chunking.
- A free, simple entry point: Google AI Studio offers a free tier with quotas that are enough to prototype and run low-volume workflows, with no credit card and no Google Cloud project. To validate a use case before committing a budget, it's hard to beat.
Creating an API key on Google AI Studio
Contrary to what you might fear with Google, accessing the Gemini API doesn't have to go through the Google Cloud console and its complexity. Google AI Studio (aistudio.google.com) is the short path:
- Sign in to Google AI Studio with a regular Google account.
- Open the API keys section ("Get API key") and generate a new key.
- Copy it and store it somewhere safe: like any API key, it grants access to your quota and should never appear in plain text inside a workflow.
In n8n, open the Credentials menu, create a Google Gemini (PaLM) credential and paste the key. That's it: no Base URL to change in the standard case. A 400 or 403 error on test almost always means a miscopied or revoked key, or an API not enabled for your account.
Note that Vertex AI, Google Cloud's enterprise offering, exposes the same models with more advanced governance — but for typical n8n workflows, the AI Studio key is more than enough and spares you the whole Cloud project setup.
The Google Gemini Chat Model node
In n8n's AI architecture, models are sub-nodes that plug in underneath a root node through the ai_languageModel connection — if this mechanism is new to you, our guide on getting started with n8n's AI nodes walks through it step by step. The Google Gemini Chat Model node behaves exactly like its OpenAI, Anthropic or Mistral counterparts: pick the model, set the temperature, and you're ready. It plugs into:
- a Basic LLM Chain for a simple, deterministic call: classification, extraction, summarization, rephrasing — the majority of automation use cases;
- an AI Agent for autonomous logic with tools and memory — see our complete guide to the AI Agent node to know when that complexity is justified;
- a Text Classifier, an Information Extractor or any other AI root node that accepts a chat model.
The huge advantage of this architecture: the model is interchangeable. If your workflows already run on OpenAI or Anthropic, testing Gemini literally means unplugging one sub-node and plugging in the other, without touching the prompt or the rest of the workflow. It's the best way to compare models on your own data rather than on generic benchmarks.
Flash or Pro: which Gemini model for which use case
Google structures its lineup around two main families, whose version names change fast but whose selection logic stays stable:
| Need | Right family |
|---|---|
| Classification, sorting, field extraction, ticket routing, high-volume summarization | Flash (fast and cost-effective) |
| Demanding writing, fine-grained document analysis, moderate reasoning | Flash first, Pro if quality falls short |
| Complex reasoning, multi-tool agents, open-ended tasks | Pro |
The reflex is the same as with any provider: start with Flash, measure quality on 50 real cases drawn from your own data, and only move up if the errors justify it. In automation, where the same prompt runs thousands of times a month, the cost gap between the two families gets multiplied by volume. Check Google's official pricing page before sizing anything: it changes regularly, and any figures published here would be stale within months.
Multimodality in practice: images, audio, PDFs
This is where Gemini stands out most clearly in an automation context. A few concrete scenarios:
- Invoices and scanned documents: send the image or PDF directly to the model with an extraction prompt and get structured fields back — no intermediate OCR service.
- Screenshots: describe an interface, extract the text from a screenshot a customer attached to a support ticket.
- Audio: transcribe or summarize a recording (voicemail, meeting) in the same call that produces the summary.
- Long documents: thanks to the large context window, have a full contract or report analyzed without splitting it.
For simple cases (an image attached to a message analyzed by an AI Agent), n8n's standard AI nodes are enough. For advanced cases — sending an audio file, a large PDF, or using a parameter the node doesn't expose — the alternative is an HTTP Request node pointed straight at the Gemini API (the generateContent endpoint), with the key passed in a header and the file encoded in the request. It's a bit more work, but it unlocks the full API surface, including the newest features that native nodes sometimes take a few weeks to catch up with.
Quotas and the free tier: what to know
AI Studio's free tier is generous for prototyping, but it enforces stricter rate limits (requests per minute and per day) than the paid tier. Two practical consequences for your workflows:
- In production, even at modest volume, a loop that chains calls without pausing will eventually hit a 429 error. Enable "Retry on Fail" on the relevant nodes and space out calls with a Wait node.
- The free and paid tiers may differ on how submitted data is used (service improvement). If your workflows handle customer or confidential data, read the terms that apply to your tier before routing a sensitive flow through Gemini — and document that decision.
Production best practices
The reflexes that apply to any LLM provider apply to Gemini without special adaptation:
- Track costs from day one: log the model, input/output tokens and originating workflow on every call, as described in our guide on tracking the cost of AI calls. The large context window is a strength, but systematically sending entire documents when an excerpt would do inflates the bill silently.
- Plan a fallback: n8n's interchangeable sub-node architecture lets you switch to another provider (or a local model via Ollama) in case of an outage or an exhausted quota. An IF node on the error code and a fallback branch to a second model are enough for critical workflows.
- Structure the output: for anything feeding downstream nodes (a score, a category, extracted fields), wire in a Structured Output Parser rather than hoping the model sticks to a format described in the prompt. Test your schema on a real sample, especially with the Flash family.
- Low temperature for deterministic tasks: 0 or 0.2 for classification and extraction, as with any model.
Common pitfalls
- Confusing AI Studio with Vertex AI: both give access to Gemini models, but with different credentials, quotas and terms. For n8n, in the standard case, the AI Studio key is the one you need — no Google Cloud project required.
- Prototyping on the free tier and deploying without leaving it: the free tier's rate limits, invisible in one-off tests, show up as soon as the workflow runs at volume. Move to the paid tier before putting a regular flow into production.
- Overusing the context window: sending 300 pages when 3 would do works, but costs more, slows the response and can dilute the model's attention away from the information that actually matters. The large window is a safety net, not an invitation to stop filtering.
- Ignoring the free tier's data usage terms for flows that handle sensitive data — check what applies to your tier before routing customer documents through it.
- Hardcoding a dated model name across dozens of workflows: Gemini versions evolve fast. Centralize the model choice (environment variable, configuration workflow) so you can migrate with a single change.
Going further
Wiring Gemini into n8n takes ten minutes: a key from Google AI Studio, a credential, the Google Gemini Chat Model node on your chain or agent. What deserves more time is testing the Flash family on your own data — in many workflows, it does the job for a fraction of a large model's cost — and exploiting what Gemini does better than the others: native multimodality on documents, images and audio. That's exactly the spirit the FlowKit packs are built in: the workflows in the RAG Assistant Pack (€119) use interchangeable model sub-nodes and therefore work with the chat model of your choice, Gemini included — a good testing ground for comparing Flash and Pro on a real document base.
FAQ
Frequently asked questions
Does n8n integrate Google Gemini natively, without a community node?
Yes. n8n ships a Google Gemini Chat Model node in its AI category, alongside the OpenAI, Anthropic and Mistral nodes. It's a model sub-node that plugs into an AI Agent, a Basic LLM Chain or a classification node, with a credential that only requires the API key created on Google AI Studio (aistudio.google.com). No full Google Cloud setup is needed to get started.
Do I need Google Cloud and Vertex AI to use Gemini in n8n?
No, not to get started. Google AI Studio provides a simple API key, with no Google Cloud project to configure and no complex billing, and that key is all the n8n credential needs. Vertex AI becomes relevant later, for enterprise needs: advanced governance, negotiated quotas, integration with an existing Google Cloud infrastructure. For typical n8n workflows, the AI Studio key is the shortest path.
Which Gemini model should I pick for my n8n workflows: Flash or Pro?
The Flash family (fast and cost-effective) covers most of automation: classification, field extraction, summarization, ticket routing — short, well-framed tasks executed at volume. The Pro family is worth it for complex reasoning, multi-tool agents and open-ended tasks. The right reflex: start with Flash, measure quality on a real sample of your own data, and only move up if the errors justify it.
Can Gemini analyze images or PDFs directly inside n8n?
Yes, it's one of its strong points: Gemini is natively multimodal and accepts text, images, audio and PDF documents as input. In n8n, simple cases go through the standard AI nodes, and advanced cases (sending an audio file, a long PDF) through an HTTP Request node calling the Gemini API directly with the content encoded in the request. This is very handy for analyzing scanned invoices, screenshots or recordings without a separate OCR service.
Bundle FlowKit Complet
€269