Templates / Triage and label Gmail emails with OpenAI GPT-5.6 Terra

Triage and label Gmail emails with OpenAI GPT-5.6 Terra

Ready for 3.0

by Louis Noël ✓ · 29 views · created 2026-08-31 · 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 28 nodes and runs on Gmail events. Along the way it connects Gmail and OpenAI Chat Model.

How it runs

Trigger: On Gmail events.

  1. Normalize email fields (Code): runs custom JavaScript code
  2. Classify email with OpenAI (AI Agent): runs an AI agent, with model: OpenAI model - email classification
  3. Validate AI result & guardrails (Code): runs custom JavaScript code
  4. Route by email category (Switch): routes items into 7 branches
  5. Apply category: Urgent (Gmail): add labels
  6. Apply category: Client (Gmail): add labels
  7. Apply category: Prospect (Gmail): add labels
  8. Apply category: Finance (Gmail): add labels
  9. Apply category: Admin (Gmail): add labels
  10. Apply category: Newsletter (Gmail): add labels

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

Services it uses

GmailOpenAI Chat Model

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) (Watch unread Gmail emails).

Nodes used (9)

From the author

Quick overview This workflow polls Gmail for unread emails, uses an OpenAI Chat Model to classify each message by category and priority, then automatically applies the corresponding Gmail label (or moves it to spam) to keep a professional inbox organized. How…

Excerpt from Louis Noël'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.