Built a smart email categorisation system using n8n and OpenAI that reads incoming Gmail messages and applies accurate custom labels automatically — replacing manual sorting and cutting unnecessary API costs.
The client had a high-volume inbox with emails from many different sources — clients, suppliers, newsletters, support requests. Gmail's rule-based filters were too rigid and kept mislabelling or missing emails. Manual sorting was eating time every single day.
They also had a previous automation that used Gmail triggers — but it was firing on every email, running up API costs unnecessarily.
Instead of firing on every single incoming email (expensive), the workflow runs on a schedule — batching unprocessed emails. This alone cut API costs significantly.
Each email's subject line and body are sent to OpenAI with a custom prompt that classifies it into the right category — client, supplier, newsletter, urgent, support, and more.
Based on the AI classification, n8n calls the Gmail API to apply the correct custom label. The inbox stays organised automatically with no manual intervention.
Inbox sorted automatically with far greater accuracy than Gmail's native filters — AI understands context, not just keywords.
Reduced API costs by switching from event-triggered to scheduled batch processing — smarter architecture, lower spend.
Hours saved weekly — the client stopped manually sorting email and started only reading what mattered, already labelled and ready.
I build smart email automation that keeps you organised without lifting a finger.