Automatic classification of incoming Gmail messages using AI nodes
Workflow Description
Automatically classify incoming Gmail messages using AI-powered analysis. When new emails arrive, the system analyzes content and assigns them to predefined categories, streamlining inbox management and saving time on manual email organization tasks.
How it works
- 1.Trigger workflow when a new message arrives in Gmail
- 2.Send email content to LLM chain with classification instructions
- 3.Parse and structure the AI response using output parser
- 4.Apply classification tag and format data for downstream actions
Use cases
- Automatically separate urgent and important emails from routine messages
- Organize customer inquiries, invoices, and alerts into dedicated folders
- Reduce time spent on manual email sorting and inbox maintenance
Requirements
- Active Gmail account with API access enabled
- OpenAI API key and configured language model settings
- Predefined classification categories and decision rules
Service Value
Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (19)
Gmail trigger
Gmail
Get message content
Gmail
Set label values
Set
Get all labels
Gmail
Split out assigned labels
Split Out
Merge corresponding labels
Merge
Aggregate label IDs
Aggregate
Add labels to message
Gmail
Assign labels for message
LLM Chain
Sticky Note
Sticky Note
Sticky Note1
Sticky Note
Sticky Note2
Sticky Note
Sticky Note4
Sticky Note
Sticky Note5
Sticky Note
Sticky Note6
Sticky Note
Sticky Note7
Sticky Note
Sticky Note8
Sticky Note
JSON Parser
Output Parser Structured
OpenAI Chat
OpenAI