Use this powerful n8n workflow template to automate Gmail labeling using Gemini AI. Integrate with InfraNodus for knowledge graph creation and send real-time alerts via Telegram. This n8n automation streamlines email management and generates insights.
Download this n8n workflow template and start using it instantly.
Individuals or teams receiving high volumes of email who need AI-driven organization.
Users who utilize n8n templates for advanced productivity and custom integrations.
Knowledge workers and researchers looking to automatically transform email content into a structured knowledge base (InfraNodus).
Anyone needing immediate Telegram notifications based on specific email categories defined within this n8n node structure.
This comprehensive n8n workflow solves the problem of manual email triage by implementing sophisticated AI classification and automated labeling. By leveraging the Google Gemini Chat Model within an n8n node, incoming emails are instantly categorized (e.g., Business, Urgent, Personal).
The value proposition is twofold: organization and insight. First, the automated labeling ensures your Gmail inbox remains tidy. Second, for key categories (like 'Business'), the workflow automatically cleans the email body and saves it as structured data in an InfraNodus knowledge graph. This process transforms unstructured email text into actionable insights, culminating in a synthesized "insight question" delivered directly to your Telegram chat. This entire n8n automation eliminates administrative overhead, ensuring crucial information is filed correctly and generating strategic ideas automatically.
This n8n workflow begins execution whenever the Gmail Trigger detects a new email that was not sent by the user (-from:me).
To leverage this powerful n8n workflow, follow these steps:
Business, Urgent, Appointments) in your Gmail account, as the Gmail Label n8n nodes require these IDs to function correctly.Text Classifier n8n node and ensure the custom categories and descriptions accurately reflect your needs. This is the core of the AI functionality in this n8n template.InfraNodus Save to Graph and InfraNodus Question Generator n8n nodes.name parameter in both nodes matches the desired graph name (e.g., gmail_business).Send Insight to Telegram and Send Notification via Telegram n8n nodes.Chat ID for the destination chat in both Telegram n8n node configurations.This robust n8n workflow template uses several specialized n8n nodes:
Gmail Trigger: The initiating n8n trigger. It monitors the inbox for new messages and excludes emails sent by the user (-from:me).
Google Gemini Chat Model: Provides the generative AI capability for classification, linked directly to the Text Classifier. Requires a Google Gemini/PaLM API credential.
Text Classifier (Langchain n8n node): Takes the email subject and body as input and uses the Gemini model to categorize the content against predefined labels (Business, Personal, Urgent, etc.). Crucial for AI-driven automation within this n8n workflow.
Gmail (Add Labels Operation): Multiple instances (e.g., Label as Business, Label as Urgent). These n8n nodes apply the specified Gmail labels based on the classification results, using the message ID captured by the initial n8n trigger.
Code n8n node (Clean html and organize into statements): Custom JavaScript function that cleans HTML/CSS from the email body and structures the remaining text into a specific format, ready for the InfraNodus API. This customized n8n node is essential for data preparation.
HTTP Request (InfraNodus Save to Graph): Sends the cleaned, formatted email text to the InfraNodus platform to build the associated knowledge graph. This step showcases advanced n8n automation via API interaction.
HTTP Request (InfraNodus Question Generator): Queries the InfraNodus API to generate an analytical "insight question" based on the graph's content gaps, demonstrating the power of the n8n template for research.
Aggregate n8n node: Used to collect the output items from multiple parallel Labeling branches (e.g., Personal, Urgent) before proceeding to the notification phase.
Automate your Gmail inbox organization using this powerful n8n workflow. Categorize incoming emails (Work, Shopping, Newsletter), apply labels, and set priority automatically using a specialized n8n node setup.

Implement the Eisenhower Matrix automatically in Gmail using this powerful n8n workflow template. Prioritize and label incoming emails as Urgent/Important with GPT-4, significantly reducing inbox clutter.

Automate Gmail inbox management using this powerful n8n workflow. GPT-4o reasons through incoming emails and assigns relevant labels automatically using a dedicated n8n node.

Use this powerful n8n workflow to automatically capture new Gmail leads, analyze intent and urgency using OpenAI GPT-4O, and log follow-up tasks in HubSpot, Slack, and Google Sheets.

I'm Dmitry, the founder of InfraNodus — an AI text network analysis tool. I'm passionate about networks and data visualization and its ability to reveal what everyone else is missing and to highlight different perspectives. I'm sharing the n8n templates that make use of this unique capability of InfraNodus for multiple scenarios.







































