Categorize Gmail emails using GPT-4o-mini with multi-label analysis
Ready for 3.0Ready 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.
What this workflow does
This AI workflow has 8 nodes and runs on Gmail events. Along the way it connects Gmail and OpenAI Chat Model.
How it runs
Trigger: On Gmail events.
- Get Gmail Labels (Gmail): work with label
- Get Email Content (Gmail): get
- Prepare Prompt (Code): runs custom JavaScript code
- GPT‑4o‑mini Label Analyzer (Basic LLM Chain): sends a prompt to an LLM
- Find Multi-Labels ID (Code): runs custom JavaScript code
- Apply Multi-Labels (Gmail): add labels
- OpenAI Chat Model: uses OpenAI Chat Model
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.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger).
Nodes used (5)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Gmail
n8n-nodes-base.gmail - Code
n8n-nodes-base.code - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
From the author
Automatically Categorize Gmail Emails with GPT-4o-mini Multi-Label Analysis Description The "Automatically Categorize Gmail Emails with GPT-4o-mini Multi-Label Analysis" template is designed specifically for professionals, business owners, entrepreneurs, and…