Templates / Classify Gmail emails with OpenAI and send urgent Telegram alerts

Classify Gmail emails with OpenAI and send urgent Telegram alerts

Ready for 3.0

by Dr. Firas ✓ · 69 views · created 2026-07-22 · Ticket Management, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 16 nodes and runs on Gmail events. Along the way it connects Gmail, OpenAI Chat Model and Telegram.

How it runs

Trigger: On Gmail events.

  1. Configuration (Edit Fields (Set)): sets 4 fields: owner_email, ai_model, enable_telegram_alerts…
  2. Get Gmail Labels (Gmail): work with label
  3. Aggregate: combines items into one
  4. Get Full Email (Gmail): get
  5. Classify Email (AI Agent): runs an AI agent, with model: OpenAI Model; 2 tools (Check Sent To Sender, Search Emails From Sender); output parser: Classification Output Parser
  6. Map Category to Label (Edit Fields (Set)): sets 4 fields: category, confidence, reasoning…
  7. Has Valid Label? (If): checks a condition and branches into true / false
  8. Apply Gmail Label (Gmail): add labels
  9. Send Telegram Alert (Telegram): uses Telegram
  10. Is Urgent & Alerts On? (If): checks a condition and branches into true / false

Services it uses

GmailOpenAI Chat ModelTelegram

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (10)

From the author

Quick overview This workflow polls Gmail for unread messages, uses OpenAI to classify each email into one of six categories based on content and prior sender history, applies the matching Gmail label, and sends a Telegram alert when an email is classified as…

Excerpt from Dr. Firas's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.