Categorize and label existing Gmail emails automatically with GPT-4o mini
Needs changesWhat this workflow does
This AI workflow has 14 nodes and runs manually, when you click “Execute workflow”. Along the way it connects Gmail and OpenAI Chat Model.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- Get many messages (Gmail): get many
- Label Checker Filter (Filter): keeps only the items that match a condition
- Give a Label AI Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Output Parser
- Switch: routes items into 7 branches
- Work (Gmail): add labels
- Personal (Gmail): add labels
- Finance (Gmail): add labels
- Shopping (Gmail): add labels
- travel (Gmail): add labels
- Newsletters (Gmail): add labels
…plus 1 more step. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in Give a Label AI Agent (v1.8): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Give a Label AI Agent (v1.8) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (7)
- AI Agent
@n8n/n8n-nodes-langchain.agent - Filter
n8n-nodes-base.filter - Switch
n8n-nodes-base.switch - Gmail
n8n-nodes-base.gmail - Manual Trigger
n8n-nodes-base.manualTrigger - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
From the author
📨 Categorize and Label Existing Gmail Emails Automatically with GPT-4o mini 👥 Who's it for This workflow is perfect for individuals or teams who want to sort and label existing emails in their Gmail inbox 🗃️ using AI. Ideal for cleaning up unlabeled emails…