Smart Gmail auto-labeler with Gemini AI & sender history
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-powe...
Template notes
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: json { "label": "Category Name" } 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