How to Connect n8n to Google Gemini: Build AI Workflows (2025)
Google's Gemini models are fast, cheap for their quality, and come with a huge context window — which makes them a strong default for document-heavy and multimodal automations. n8n supports Gemini both as a standalone node and as a chat model for AI Agents.
This guide shows how to get a Gemini API key, connect it in n8n, and use it for the tasks it does best: classification, summarization, vision, and long-context reasoning.
Why choose Gemini for n8n workflows
- Large context window — Gemini 1.5/2.x models handle very long documents, so you can summarize entire contracts or transcripts in one call.
- Native multimodal — send images, PDFs, and audio directly, no separate OCR step.
- Cost-efficient tiers — Flash models are inexpensive for high-volume classification and extraction.
- Generous free tier — the Google AI Studio key gives you free requests to prototype before paying anything.
Step 1 — Get a Gemini API key
Go to Google AI Studio (aistudio.google.com), sign in, and click Get API key → Create API key. Copy it. This key works against the Gemini API directly — you don't need a full Google Cloud project to start, though you can attach one for higher quotas and billing.
Step 2 — Add the Google Gemini credential in n8n
n8n ships a Google Gemini (PaLM) Chat Model node and a Google Gemini node. Add one, create a new credential of type Google Gemini(PaLM) API, paste your key, and save. n8n validates it immediately. If your n8n version predates the dedicated node, you can always call Gemini via the HTTP Request node against generativelanguage.googleapis.com with the key as a query parameter — but the native node is simpler.
Step 3 — Use Gemini as a chat model in an AI Agent
The most powerful pattern is plugging Gemini into n8n's AI Agent node as its language model. Drag an AI Agent node, then connect the Google Gemini Chat Model to its Chat Model input. Add tools (HTTP, database, search) and Gemini will reason over them to complete tasks — the foundation of any agentic workflow.
Five production-ready AI workflows in one pack
Skip the wiring. This pack gives you five advanced AI automations you can drop Gemini or any model into and run today.
Step 4 — Practical Gemini tasks to build first
Concrete, high-ROI uses:
- Ticket / email classification — send the text, ask for a category and urgency as JSON, branch on the result.
- Document summarization — feed a long PDF and get an executive summary, exploiting the big context window.
- Invoice / receipt vision — attach an image and extract fields to structured JSON in a single call.
- Content generation — draft blog posts, product descriptions, or replies grounded in your data.
Tip: ask Gemini to respond in strict JSON and enable the node's JSON output parsing so downstream nodes get clean fields.
Cost and rate-limit tips
- Use Flash models for high-volume, simple tasks and reserve Pro for complex reasoning.
- Batch where you can — one call over a long document beats many small calls.
- Watch the free-tier RPM limit; add a Wait or loop-with-delay for bulk jobs to avoid 429 errors.
- Set a low
temperaturefor extraction/classification to keep output deterministic.
Frequently asked questions
Is Gemini free in n8n?
The n8n node is free. Google offers a free Gemini API tier via AI Studio; beyond that you pay per token, which is very low for the Flash models.
Can I switch between Gemini, OpenAI, and Claude?
Yes. n8n's AI Agent accepts any chat model node, so you can swap providers by changing one node — useful for cost/quality testing.
Does Gemini handle images and PDFs?
Yes, natively. Send the file to the Gemini node and ask for extraction or description — no separate OCR service required.
Ready to automate this?
Skip the build. The AI Automation Pack — 5 Advanced AI Workflows template is ready to import into n8n — plug in your credentials and it runs. One-time purchase, yours forever, no subscription.