AI-Powered Gmail Email Classification Workflow in n8nAI-Powered Gmail Email Classification Workflow in n8n
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
AI-Powered Email Classification Workflow | n8n Automation

Built an intelligent email automation system using n8n that automatically reads incoming emails, classifies them by department using AI, and forwards them to the right team without any human input.
The workflow connects directly to Gmail and triggers the moment a new email arrives. A JavaScript node extracts the key email details, including sender, subject, body, and date, before passing them to an AI Agent powered by GPT-4o-mini. The AI reads the email content and classifies it into one of six departments: Sales, Customer Service, HR, Finance, Operations, or Other.
A Switch node then routes the email down the correct branch, and a Gmail node automatically forwards it to the right department inbox with a clear label in the subject line.
What it does:
Monitors a Gmail inbox in real time
Extracts and cleans email data automatically
Uses AI to classify emails by department
Routes and forwards emails to the correct team
Fully automated with zero manual sorting required
Result: Emails that would normally sit unread or require manual sorting now reach the right department within seconds of arriving.
Post image
Post image
Post image
Post image
Johnson's avatar
Seeing the Gmail trigger pull in new messages and the GPT agent decide the right department saves the whole inbox from piling up.
Nathaniel's avatar
Exactly! That was the main goal, to take the repetitive sorting off the team and let the AI handle the routing automatically. Thanks for checking it out! 🙌
Oleg's avatar
Nice implementation. The production question is what happens to ambiguous emails. I usually add a confidence threshold, an “unclassified” review queue, and retention of the original message so a routing mistake can be corrected without losing context.
Nathaniel's avatar
Thank you! Really good points. The workflow currently has an "Other" branch that catches anything the AI is not confident about and flags it for manual review, which handles most ambiguous cases. Retaining the original message is something I am already doing by passing the full...
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started