Use this powerful n8n workflow to automatically classify and label incoming Gmail emails using Gemini 2.5 Pro. Leverage this n8n template for precise inbox management.
Download this n8n workflow template and start using it instantly.
Users drowning in emails who need automated categorization.
n8n experts looking for advanced AI-driven email management solutions.
Technical users wanting to see how the n8n Code node maps data between AI output and service IDs.
Professionals seeking a ready-to-use n8n template for Google services and LLMs.
Managing a busy inbox manually is inefficient. This specialized n8n workflow solves the problem by automating the classification of new, unread emails. It leverages the power of the Gemini 2.5 Pro model to analyze the email subject and snippet, determine the most suitable existing Gmail label, and instantly apply it. Unlike static filtering, this dynamic solution ensures highly accurate categorization based on context. This powerful n8n template starts with an n8n trigger watching your inbox and ends with a perfectly filed email. The beauty of this n8n workflow is that it dynamically pulls your existing labels, so you never need to update the n8n node configuration when you create a new label, ensuring a resilient n8n workflow.
Gmail Trigger (n8n trigger): The starting point of this n8n workflow. It monitors for new emails, specifically configured to look only for unread messages.
Get many labels (Gmail n8n node): Retrieves a list of all custom and default labels in your Gmail account (returnAll: true). This is crucial for providing the AI with a controlled, accurate list of classification options.
Aggregate (n8n node): Combines the email data from the trigger with the label data, ensuring the label list is available in the subsequent nodes.
Edit Fields (Set n8n node): Creates the labelList variable containing all fetched label names, formatted as a comma-separated string for optimal prompt injection into the AI model.
Message a model (Google Gemini n8n node): Uses models/gemini-2.5-pro for classification. The system message strictly enforces that the output must be a comma-separated list of existing labels, preventing incorrect or invented classifications.
Code (n8n node): Performs the necessary data transformation. It parses the AI's text output and dynamically converts the predicted label names into the necessary unique Gmail labelIds required by the final Gmail n8n node.
labelIds to the email identified by the messageId retrieved from the initial n8n trigger. This is a standard Gmail n8n node configured for the addLabels operation.Use this n8n workflow to automatically synchronize contacts from Google Sheets directly to a MailChimp subscriber list. Perfect for email marketing automation using n8n templates.

Use this powerful n8n workflow to automate social media posting on Bluesky. Leverages Groq for rapid AI content generation, ensuring character limits are met. Explore advanced n8n templates for social media.

Automate Instagram Reel creation using GPT-4, Veo3 video generation, and Blotato publishing. This robust n8n workflow handles prompt ideation, video creation, and auto-posting, leveraging the power of custom n8n templates.

Automate Gmail organization using an n8n workflow leveraging GPT-4o-mini. Classify emails (Job, Application Status, Enquiries) and apply custom Gmail labels automatically using this powerful n8n template.

Use this comprehensive n8n workflow to automate social media moderation. Instantly detect toxic Instagram comments using the Perspective API, hide them, and notify your team via Slack and Google Sheets.

Use this powerful n8n workflow to automatically monitor the n8n GitHub RSS feed for new major releases. Receive instant notifications via Telegram and AWS SES email when a new n8n version drops, ensuring timely upgrades.








































