AutomationMart
Home/Browse/Smart Gmail auto-labeler with Gemini AI & sender history
n8n

Smart Gmail auto-labeler with Gemini AI & sender history

n8nn8n16 modulesv1.0
GmailZoomGemini

n8n Gmail AI Auto-Labeler > An intelligent n8n workflow that automatically classifies and labels Gmail emails using Google Gemini AI, keeping your inbox organized with zero manual effort. This workflow uses AI-powered classification to analyze email content, learn from sender patterns, and automatically apply appropriate labels while archiving processed emails. --- How It Works 1. Trigger: The workflow runs automatically every minute to check for new unread emails (or manually for bulk proces

At a glance

Smart Gmail auto-labeler with Gemini AI & sender history is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Gmail, Zoom, Gemini. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Gmail, Zoom, Gemini
Modules
16
Price
Free
Version
v1.0
Smart Gmail auto-labeler with Gemini AI & sender history workflow diagram

About this workflow

n8n Gmail AI Auto-Labeler > An intelligent n8n workflow that automatically classifies and labels Gmail emails using Google Gemini AI, keeping your inbox organized with zero manual effort. This workflow uses AI-powered classification to analyze email content, learn from sender patterns, and automatically apply appropriate labels while archiving processed emails. --- How It Works 1. Trigger: The workflow runs automatically every minute to check for new unread emails (or manually for bulk processing). 2. Check for Existing Labels: Before processing, it verifies if the email already has an AI-assigned label to avoid duplicate processing. 3. AI Classification: If unlabeled, the AI agent analyzes the email using: Sender History Tool - Fetches up to 10 previous emails from the same sender to identify patterns 80% Majority Rule - If 80%+ of sender's past emails have the same label, strongly prefers that category Label Examples Tool - When uncertain, compares the email with existing examples from suspected categories 4. Smart Decision: The AI returns a structured JSON response: Or "None" if no category fits. 5. Apply & Archive: Label Applied → The workflow adds the appropriate Gmail label to the thread. Auto-Archive → Removes the email from INBOX (archives it) to maintain zero-inbox. 6. Loop: Processes the next email in the batch, ensuring all new emails are classified. --- Requirements Gmail OAuth2 Credentials - Connected Gmail account with API access. Google Gemini API Key - Get it here Free tier: 15 requests/minute Gmail Labels - Must be created in Gmail exactly as listed: Meetings Income Inquiries Notify / Verify Expenses Orders / Deliveries Trash Likely --- How to Use 1. Import the Workflow: Copy the provided JSON file. In your n8n instance → click Import Workflow → select the JSON file. 2. Create Gmail Labels: Open Gmail → Settings → Labels → Create new labels. Use the exact names listed above (case-sensitive). 3. Get Your Label IDs: In the workflow, click "When clicking 'Execute workflow'" manual trigger. Execute the "Get Labels Info" node only. Copy each label's ID (format: Label1234567890123456789). 4. Update Code Nodes with Your Label IDs: Node 1: "Check Label Existence" Node 2: "Convert Label to Label ID" 5. Set Up Credentials: Gmail OAuth2 → Authorize your Gmail account in n8n. Google Gemini API → Add your API key in n8n credentials. 6. Test the Workflow: Send yourself test emails with clear content (e.g., invoice, meeting invite). Use the manual trigger to process them. Verify labels are applied correctly. 7. Activate for Auto Mode: Toggle the workflow to Active. New unread emails will be processed automatically every minute. --- Notes Dual Execution Modes: Auto Mode - Gmail Trigger polls inbox every minute for unread emails (real-time processing). Manual Mode - Use the manual trigger to bulk process existing emails (adjust limit in "Get many messages" node). AI Learning from Patterns: The workflow applies an 80% majority rule - if 80% or more of a sender's historical emails share the same label, the AI strongly prefers that category for new emails from that sender. This creates intelligent sender-based routing over time. Skip Already Labeled Emails: The "Check Label Existence" node prevents re-processing emails that already have an AI-assigned label. Ensures efficient execution and avoids duplicate work. Structured AI Output: Uses a Structured Output Parser to ensure the AI always returns valid JSON: { "label": "Category" }. If uncertain, returns { "label": "None" } and the email stays in inbox. Background Archiving: After labeling, emails are automatically removed from INBOX (archived). Maintains a zero-inbox workflow while preserving emails under their labels. Rate Limits: Google Gemini free tier: 15 requests/minute. Adjust polling frequency if hitting limits. --- Example Behavior Minute 1: New invoice email arrives → AI fetches sender history → 85% were labeled "Expenses" → applies "Expenses" label → archives email. Minute 2: Meeting invite arrives → No sender history → AI analyzes content (Zoom link, time) → applies "Meetings" label → archives email. Minute 3: Promotional email arrives → AI compares with "Trash Likely" examples → applies label → archives email. Minute 4: Already-labeled email detected → skipped silently. --- Label Categories | Label | Description | |-------|-------------| | Meetings | Calendar invites, Zoom/Meet links, appointments, scheduled events | | Expenses | Bills, invoices, receipts, payment reminders, subscription renewals | | Income | Payments received, payouts, deposits, earnings notifications | | Notify / Verify | Verification codes, login alerts, 2FA codes, account notifications | | Orders / Deliveries | Order confirmations, shipping updates, tracking numbers, deliveries | | Inquiries | Business outreach, sales proposals, partnerships, cold emails | | Trash Likely | Spam, newsletters, promotions, marketing blasts, ads | > If no category fits clearly, the email returns "None" and remains in the inbox. --- Customization Change Polling Frequency: Edit the "Gmail Trigger" node → pollTimes → mode (e.g., every5Minutes). Adjust Email Limit: Modify limit: 10 in "Get many messages" node for manual bulk processing. Add Custom Labels: Create in Gmail → Get ID → Update both Code nodes + AI system prompt. Modify 80% Rule: Edit the AI agent's system message to adjust the majority threshold. Increase Tool Limits: Change limit: 10 in Gmail tool nodes to fetch more historical data. --- Author: Muhammad Anas Farooq

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Create a Document from a Template containing data from a record in Airtable

When a new record from Airtable is received, a new document from a template and with values from the record is created and then sent to Gmail as PDF.

Free

Automate Real Estate Listing Scraper 🏠🤖 with ScrapeGraph AI and Google Sheets

This workflow automates the process of scraping real estate property listings from websites using ScrapeGraph AI, extracting structured data, and saving it to a Google Sheet. It is designed to handle paginated listing pages and can be adapted to any real estate site that uses URL parameters for pagination. NOTE: This workflow has been tested with Immobiliare.it, the #1 real estate website in Italy. However, it is designed to be adaptable by modifying the pagination parameter and the

Free

Add attachments received by Gmail to a Shufflrr Folder and notify by a Slack message

Every time a new email is received to your Gmail, Make will automatically iterate through the attachments of that email, upload it to a Shufflrr folder, and send a new message in Slack.

Free

Automatically delete spam emails in Gmail on schedule

Who is this for? If you hate SPAM emails or don't want to clean them up frequently. What problem is this workflow solving? It automatically deletes SPAM emails for you, so you don't have to. Save a bit of your time. What this workflow does - You can specify when to execute the workflow: daily, weekly, or monthly. Setup - Select the preferred execution time - Configure credentials for Gmail OAuth2 How to customize this workflow to your needs - There's no need. It just works!

Free

Build a PDF Document RAG System with Mistral OCR, Qdrant and Gemini AI

This workflow is designed to process PDF documents using Mistral's OCR capabilities, store the extracted text in a Qdrant vector database, and enable Retrieval-Augmented Generation (RAG) for answering questions. Here’s how it functions: Once configured, the workflow automates document ingestion, vectorization, and intelligent querying, enabling powerful RAG applications. --- Benefits End-to-End Automation No manual interaction is needed: documents are read, proc

Free

Automate HR candidate shortlisting with Sheets, Gmail, ClickUp & Calendly

Description This n8n workflow automates the candidate shortlisting process by integrating Google Sheets, Gmail, ClickUp, and Calendly. It fetches candidate records, filters high-scoring profiles, sends personalized advancement emails, and creates screening tasks for your HR team—all with a single manual trigger. 🚀 What It Does Fetch All Candidate Records - Retrieves complete candidate data (names, scores, contact info, summaries) from the ‘Resume store’ Google Sheet (Sheet2). - Efficiently loads

Free

Grok Imagine Video Chatbot 🤖📺: Generate & Modify Videos via Natural Language

The Video Grok Agent is an AI-powered video generation and editing workflow that uses Grok 4.1 Fast (via OpenRouter) and Grok Imagine Video to create and modify videos through natural language. This workflow enables seamless AI-driven video creation and editing through a conversational interface, with built-in validation, async processing, and secure credential management. --- Key Advantages 1. ✅ Unified Video Creation Pipeline A single workflow supports text-to-vide

Free

Auto-post breaking news content using Perplexity AI to X (Twitter)

Stay ahead of the curve and keep your followers informed—automatically. This n8n workflow uses Perplexity AI to generate insightful answers to scheduled queries, then auto-posts the responses directly to X (Twitter). --- ⚙️ What this workflow does 1. Scheduled Trigger – Runs at set times (daily, hourly, etc.). 2. searchQuery – Define what kind of trending or relevant insight you want (e.g. “latest AI trends”). 3. set API Key – Securely insert your Perplexity API key. 4. Perplexity API Call – Fe

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free