Templates / Classify Gmail emails with OpenAI and Telegram feedback

Classify Gmail emails with OpenAI and Telegram feedback

Needs changes

by Michael Montaque · 24 views · created 2026-05-19 · Ticket Management, AI Summarization

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This AI workflow has 30 nodes and runs when another workflow calls it (plus 2 other triggers). Along the way it connects OpenAI Chat Model, Telegram, Data table and Gmail.

How it runs

Trigger: When another workflow calls it (plus 2 other triggers).

  1. Gmail: get many
  2. Get labels (Gmail): work with label
  3. Get all labels (Gmail): work with label
  4. Filter: keeps only the items that match a condition
  5. get AI labels (Filter): keeps only the items that match a condition
  6. Add label map (Code): runs custom JavaScript code
  7. Get all pending rules (Data table): get
  8. set confidence threshold (Code): runs custom JavaScript code
  9. Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
  10. AI Check Email (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 1 tool (Previous Rules and actions tool); output parser: Unwanted Email Output Parser

…plus 13 more steps. See the full node list below.

Services it uses

OpenAI Chat ModelTelegramData tableGmail

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • AI Agent v1 (old agent modes) in AI Check Email (v1.8): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
  • Also check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll).

Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).

Published 2026 — 6% of 2026 templates need changes for 3.0. See how template age affects 3.0 readiness →

Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.
Removed in 3.0Replace with
AI Agent v1 (old agent modes)
AI Check Email (v1.8)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (15)

From the author

An AI-powered Gmail assistant built with n8n that automatically labels emails, learns from your decisions, and safely improves over time using human-in-the-loop training. This workflow combines: - Gmail - OpenAI - Telegram - n8n Data Tables to create a…

Excerpt from Michael Montaque'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.