Smart Email Assistant with Gemini AI Classification and Telegram Approval - n8n Workflow

Use this advanced n8n workflow to classify Gmail messages instantly using Google Gemini AI, generate automated replies requiring human approval via Telegram, and receive daily email digests.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Professionals receiving a high volume of emails who need priority sorting.
Users looking for advanced aiautomationworkflows using n8n.
Developers needing robust n8n templates for integrating Gmail, AI, and chat apps.
Anyone who requires human oversight (approval) before sending AI-generated replies.

Overview

Managing a high volume of email requires immediate prioritization, which is where this powerful n8n workflow excels. It solves the critical problem of email overload by automatically classifying incoming Gmail messages into actionable categories: Requires Reply, Important Notification, or Unimportant. By leveraging Google Gemini (via n8n Langchain nodes) for sophisticated analysis, the n8n workflow ensures that urgent emails are addressed immediately, offering a drafted reply that requires explicit human approval via Telegram before being sent. Furthermore, it runs a scheduled daily n8n trigger to summarize all emails from the past 24 hours, delivering a concise digest directly to your Telegram chat. This sophisticated n8n template transforms your inbox into a prioritized, automated task list.

How it Works

This n8n workflow operates on two parallel paths, ensuring both real-time response capability and daily organization:


  1. Real-Time Email Triage:

The process begins with the n8n trigger, Real-time Email Trigger (a Gmail Trigger n8n node), listening for new emails.
An If n8n node (Check: Is Email in Inbox?) ensures only messages currently in the INBOX are processed.
The AI Email Classifier node uses Google Gemini to categorize the email.
The Route by Category n8n node directs the flow:
If the category is Requires Reply (0), the AI: Generate Email Reply node drafts a response. This draft is sent to Telegram via the Telegram: Send + Approve n8n node, awaiting human approval. If approved, the Send Email Reply n8n node executes the response using the Gmail n8n node.
If the category is Important Notification (1), the Summarize Email with AI node creates a brief summary, which is immediately sent to Telegram via the Send Summary to Telegram n8n node.
If the category is Spam/Unimportant (2), the n8n workflow terminates via an Exit node.


  1. Daily Email Digest:

A scheduled n8n trigger (Daily 8AM Trigger) initiates the daily summary.
The Fetch Emails Gmail n8n node retrieves the last 24 hours of messages.
Data is consolidated using the Organize Email Data n8n node.
The Email Summarizer node uses a detailed Google Gemini prompt to generate a comprehensive, structured report (including action items and issues).
The final report is sent using the Send Daily Report Telegram n8n node. This comprehensive n8n workflow structure maximizes efficiency.

Installation Guide


  1. Import: Copy the provided n8n workflow JSON code and paste it into your n8n instance using the "Import Workflow" function.

  2. Credentials Setup:

Gmail OAuth2: Connect the Gmail n8n node instances (Real-time Email Trigger, Fetch Emails, and Send Email Reply) to your Gmail OAuth2 credentials.
Telegram Bot API: Configure credentials for Telegram and assign them to all Telegram n8n node instances.
Google API (for Gemini/PaLM): Configure the Google API credentials and link them to all four Google Gemini Chat Model n8n nodes (used by the AI Agents).

  1. Configuration:

In the Telegram n8n node instances, replace [YOURTELEGRAMCHAT_ID] parameter placeholder with your specific Telegram chat ID where you want to receive notifications and approval requests.
* Activate the n8n workflow to enable both the real-time and scheduled n8n trigger components.

Node Details

Real-time Email Trigger (Gmail Trigger n8n node): This is the starting n8n trigger for the real-time processing flow, monitoring for new emails in your inbox.
AI Email Classifier (LangChain Agent n8n node): Uses Google Gemini to classify emails into 3 categories (0, 1, or 2) based on urgency and action required. Key Configuration: Uses Structured Output Parser1 to guarantee JSON output.
Route by Category (Switch n8n node): The central flow control, routing the n8n workflow path based on the category output by the AI.
AI: Generate Email Reply (LangChain Agent n8n node): When a reply is needed, this n8n node drafts a professional response, formatted as a JSON object, ready for sending.
Telegram: Send + Approve (Telegram n8n node): Sends the draft and email details to Telegram for human review. Key Configuration: Uses the sendAndWait operation with approval options, providing a 5-minute timeout for human intervention.
Send Email Reply (Gmail n8n node): Executes the actual email reply action only if the Telegram approval check passes.
Summarize Email with AI (LangChain Agent n8n node): Generates a concise summary for immediate notification purposes for Category 1 emails.
Daily 8AM Trigger (Schedule Trigger n8n node): The scheduled n8n trigger that starts the daily digest process.


  • Email Summarizer (LangChain Agent n8n node): Analyzes aggregated daily email data using Google Gemini and generates a comprehensive, structured daily report for Telegram, utilizing sophisticated prompt engineering.

Related n8n Workflows

Free

Nodes: 12 Nodes
Updated: December 26 2025
View all
Created by

I love building smart n8n automations that actually work reliably. My focus is on making everyday tasks like email, social media, and CRM workflows simpler using AI. I've shared templates in the n8n community, including a WhatsApp Expense Tracker that people really enjoy. What keeps me excited is constantly trying new things - testing fresh nodes, playing with AI tools like LangChain, and discovering creative ways to connect systems!

Featured*