Templates / Automated Gmail classification and labeling with GPT-4, Sheets and Slack alerts

Automated Gmail classification and labeling with GPT-4, Sheets and Slack alerts

Ready for 3.0

by Chris Mielke · 157 views · created 2025-12-15 · 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 21 nodes and runs on Gmail events. Along the way it connects OpenAI Chat Model, Gmail, Google Sheets and Slack.

How it runs

Trigger: On Gmail events.

  1. Extract and Clean Email Content (Code): runs custom JavaScript code
  2. Classify and Extract Entities (AI Agent): runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Output Parser
  3. Parse and Validate AI Response (Code): runs custom JavaScript code
  4. Check Classification Success (If): checks a condition and branches into true / false
  5. Check if High Priority or Urgent (If): checks a condition and branches into true / false
  6. Route by Category (Switch): routes items into 9 branches
  7. Log Classification Errors (Google Sheets): append or update
  8. Send Urgent Email Alert (Slack): uses Slack
  9. Label: Inquiry (Gmail): add labels
  10. Label: Support Request (Gmail): add labels

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

Services it uses

OpenAI Chat ModelGmailGoogle SheetsSlack

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.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Check Every 2 Min).

Nodes used (10)

From the author

This n8n template automates email labeling using AI-enhanced classification and intelligent routing Gmail users report spending significant time manually sorting email, so this tool helps alleviate that burden. How it works - Gmail Trigger monitors unread…

Excerpt from Chris Mielke'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.