Declutter Gmail: archive inactive emails with GPT-4 classification
Ready for 3.0What 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).
- List old inbox emails (Gmail): get many
- Loop Over Emails (Loop Over Items (Split in Batches)): loops over the items in batches
- Prep Email for AI (Edit Fields (Set)): sets 4 fields: threadId, messageId, Subject…
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Output Parser
- If: checks a condition and branches into true / false
- Archive Email (Gmail): remove labels (thread)
Services it uses
Other OpenAI + Gmail templates (1,623)
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)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Gmail
n8n-nodes-base.gmail - Edit Fields (Set)
n8n-nodes-base.set - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - No Operation, do nothing
n8n-nodes-base.noOp - If
n8n-nodes-base.if
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…