Templates / Label incoming Gmail messages with Google Gemini and Telegram alerts

Label incoming Gmail messages with Google Gemini and Telegram alerts

Ready for 3.0

by Yuvraj Soni ✓ · 140 views · created 2026-06-25 · Document Extraction, 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.

Nodes used (6)

Text ClassifierGmailTelegramGoogle Gemini Chat Model

What it does

Quick overview This workflow polls Gmail for new emails, uses Google Gemini via an n8n AI text classifier to categorize each message by subject and snippet, and automatically applies the matching Gmail label, sending a Telegram alert if classification errors occur. How it works 1. Checks Gmail every minute for new emails using the Gmail Trigger. 2. Sends the email subject and snippet to a Google Gemini-powered text classifier to assign a category (Personal, Job, Study Related, Bank, Social, OTP, or Misc). 3. Adds the corresponding Gmail label to the message in Gmail based on the predicted category. 4. Sends a Telegram message to the configured chat ID if the classifier step produces an error. Setup 1. Connect your Gmail account using Gmail OAuth2 and ensure the trigger has access to the mailbox you want to label. 2. Add a Google Gemini (PaLM) API key credential for the AI classification step. 3. Create (or choose) the target Gmail labels and replace the label IDs in each “addLabels” action with your own. 4. Add Telegram bot credentials and set the correct chat ID in the Telegram message step (or disable it if you don’t want error alerts).

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.