Deploy this efficient n8n workflow to automatically classify new Gmail emails using AI (OpenRouter/Gemini) and apply the correct organizational labels instantly. Perfect for reducing inbox clutter.
Download this n8n workflow template and start using it instantly.
Individuals struggling with inbox clutter and seeking automated organization.
Professionals who need standardized categorization of communication (e.g., "FYI," "To respond").
Developers looking for advanced n8n templates integrating LangChain LLM capabilities with core services.
Users seeking to leverage an external AI model via an n8n node for production tasks.
Managing an overflowing inbox is a constant challenge. This powerful n8n workflow solves this by introducing intelligent, automated email triage. Instead of manually reading and labeling dozens of emails daily, this automation instantly analyzes the content (snippet, subject, sender) using a detailed system prompt via the OpenRouter service (Gemini model). The result is a perfectly labeled inbox, ensuring high priority items are immediately categorized as 'To respond' or 'FYI,' drastically reducing cognitive load. This robust n8n workflow serves as an excellent foundation for more complex communication automations, showcasing the flexibility of the n8n platform and its diverse n8n node library.
The process begins with the New Gmail Email Received n8n trigger, which initiates the n8n workflow whenever a new email lands.
To deploy this useful n8n workflow template, follow these steps:
New Gmail Email Received (n8n trigger): The entry point for the n8n workflow. It monitors the linked Gmail account for new incoming emails, retrieving key metadata like the snippet, subject, and message ID.
Fetch Available Gmail Labels (Gmail n8n node): Retrieves a list of all custom and default labels in the user's Gmail account. This is essential for the final step to know the correct ID for the AI-generated label name.
Map Label Names to IDs (Code n8n node): A custom JavaScript n8n node that transforms the label array output from the previous step into an easily accessible JSON object where the key is the label name and the value is the Label ID. This enables quick lookup later in the n8n workflow.
OpenRouter Chat Model (LangChain n8n node): Specifies the AI provider and model (Gemini 2.5 Flash via OpenRouter) used for classification.
Classify Email with AI (LangChain n8n node): Executes the classification logic. It feeds the email snippet and metadata into the LLM alongside a detailed, multi-rule system prompt, ensuring the output is a standardized label name.
Apply Classification Label (Gmail n8n node): The final action. It uses expression logic to dynamically retrieve the correct Label ID based on the AI's classification output ({{ $('Map Label Names to IDs').item.json.combinedObject[$json.text] }}) and adds that label to the original email using the addLabels operation.
Use this powerful n8n workflow to automatically assign stale JIRA support tickets. It leverages OpenAI and a Supabase vector database to match issues to the best-suited, highest-capacity team member, powered entirely by n8n templates.

Use this powerful n8n workflow to automatically synchronize your RAG knowledge base. Triggered by Google Drive updates, it handles LlamaIndex parsing and Azure OpenAI embeddings.

Automate content localization using DeepL and n8n. This n8n workflow detects new YouTube videos, translates the title and description to Japanese, and publishes the localized summary directly to a Slack channel.

Automate Instagram engagement and commenting using this powerful n8n workflow. It combines GPT-4o for dynamic content generation, Phantombuster for automated posting, and SharePoint for reliable deduplication, ensuring high-quality, controlled social activity.

Automate AI short video creation from a simple Telegram prompt, generating music, captions, and publishing instantly to 9 social media platforms using this advanced n8n workflow.

Kiwi Developer & Founder. Working on AI Startups while in London. Passionate about AI Tech, Learning, and Helping Engineers.







































