Skip to main content

Triage Gmail and send high-priority alerts with Gemini and Telegram

Workflow preview

Workflow preview
100%
Triage Gmail and send high-priority alerts with Gemini and Telegram preview
Open on n8n.io

1. Workflow Overview

Quick overview This workflow checks Gmail every hour, filters out automated senders, uses Google Gemini to summarize and classify each new email, logs the analysis to an n8n Data Table, and sends a...

Best for

  • Ticket Management automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.set, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.datatable, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.telegram

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Nguyễn Thiệu Toàn (Jay Nguyen).

Original n8n.io source

1.1 Workflow description

Title
Triage Gmail and send high-priority alerts with Gemini and Telegram
Workflow name
Triage Gmail and send high-priority alerts with Gemini and Telegram

Quick overview

This workflow checks Gmail every hour, filters out automated senders, uses Google Gemini to summarize and classify each new email, logs the analysis to an n8n Data Table, and sends a Telegram alert when an email is marked as high priority.

How it works

  1. Runs every hour and pulls new emails from Gmail.
  2. Normalizes the email fields (sender, subject, received time, body text) and truncates long content while filtering out senders that match blocked “no-reply/newsletter” keywords.
  3. Checks an n8n Data Table for the email’s message ID to skip messages that were already processed.
  4. Sends the cleaned email content to Google Gemini, which returns a structured JSON with summary, category, priority, action items, deadline, sentiment, and key entities.
  5. Upserts the email metadata and Gemini analysis into the n8n Data Table for tracking and search.
  6. If Gemini rates the email as High priority, sends a formatted Telegram message with the summary, required action, and deadline.

Setup

  1. Connect a Gmail credential (service account as configured) and ensure the Gmail Trigger has access to the mailbox you want to monitor.
  2. Add a Google Gemini (Google PaLM) API credential for the Gemini chat model used by the email analysis step.
  3. Create an n8n Data Table with the expected columns and paste its ID into the data_table_id value in the Set Context step.
  4. Connect a Telegram Bot credential and set the correct Telegram chat ID in the Telegram alert step (replace the current value if needed).
  5. Review and update the Set Context values (owner name/email, blocked sender keywords, and max content length) to match your preferences.

Requirements

  • n8n Version: Built and tested on n8n 2.20.0+. (Note: You may encounter errors on older versions. It is highly recommended to update to the latest n8n version to use this workflow effectively).
  • Google Gemini API key credential.
  • Gmail OAuth2 credential.
  • Telegram Bot API credential and Chat ID.
  • Built-in n8n Data Table feature enabled.

Customization

  • Switch the Input Source: You don't have to use Gmail. Swap the trigger for an IMAP, Outlook, or Zoho Mail node if you use a different provider.
  • Refine the AI Persona: Modify the system prompt inside the AI Agent node to fine-tune how it categorizes emails specific to your industry (e.g., adding a "Lead", "Support Ticket", or "Invoice" category).
  • Change the Alert Channel: Prefer team visibility? Replace the Telegram node with a Slack or Discord node to notify an entire channel when a high-priority email arrives.

Additional info

About the Author

Created by: Nguyễn Thiệu Toàn (Jay Nguyen) Email: [email protected] Website: nguyenthieutoan.com Company: GenStaff (genstaff.net) Socials (Facebook / X / LinkedIn): @nguyenthieutoan More templates: n8n.io/creators/nguyenthieutoan

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Set Context

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 2 - Parse Email Fields

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Filter Noise & Bots

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 4 - Already Logged?

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1.1

Block 5 - Is New Email?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 6 - AI Email Analyzer

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 7 - Google Gemini Flash

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1.1

Block 8 - Parse Analysis JSON

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 9 - Log to Data Table

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1.1

Block 10 - Notify via Telegram (High Priority)

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 11 - Send Telegram Alert

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 12 - Main Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Section 1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Section 2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Section 3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Warning Setup

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Author Message

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Gmail Trigger

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.4

3. Summary Table

Workflow Triage Gmail and send high-priority alerts with Gemini and Telegram
Complexity advanced
Nodes 18
Categories Ticket Management, AI Summarization
Author Nguyễn Thiệu Toàn (Jay Nguyen)
Published 30 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16032/16032.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Triage Gmail and send high-priority alerts with Gemini and Telegram do?

Quick overview This workflow checks Gmail every hour, filters out automated senders, uses Google Gemini to summarize and classify each new email, logs the analysis to an n8n Data Table, and sends a...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management, AI Summarization use case.