Templates / Declutter Gmail: archive inactive emails with GPT-4 classification

Declutter Gmail: archive inactive emails with GPT-4 classification

Ready for 3.0

by Matt Chong | n8n Creator ✓ · 495 views · created 2025-08-24 · AI Summarization, Multimodal AI

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-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This AI workflow has 10 nodes and runs on a schedule (every day at 02:00). Along the way it connects Gmail and OpenAI Chat Model.

How it runs

Trigger: On a schedule (every day at 02:00).

  1. List old inbox emails (Gmail): get many
  2. Loop Over Emails (Loop Over Items (Split in Batches)): loops over the items in batches
  3. Prep Email for AI (Edit Fields (Set)): sets 4 fields: threadId, messageId, Subject…
  4. AI Agent: runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Output Parser
  5. If: checks a condition and branches into true / false
  6. Archive Email (Gmail): remove labels (thread)

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.

Nodes used (9)

From the author

Who is this for? This workflow is for professionals, entrepreneurs, or anyone overwhelmed by a cluttered Gmail inbox. If you want to automatically archive low-priority emails using AI, this is the perfect hands-free solution. What does it solve? Your inbox…

Excerpt from Matt Chong | n8n Creator'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.