Gmail email classification with Gemini and Brevo contact upsert workflow
This n8n workflow captures incoming Gmail messages, marks them as read and categorises each inquiry with a Google Gemini text classifier. Conditional branches separate active contract threads from guest-post or video requests before applying Gmail labels. Contact details upsert into Brevo and structured email replies run on your server.
- Catalogue ID
- #0796
- Functional nodes
- 11
- Connections
- 12
- Trigger
- gmailTrigger
- AI layer
- AI-assisted
Business problem solved
Marketing and partnerships inboxes fill up with repetitive sponsorship, guest-article and media requests mixed alongside live client conversations. Sorting labels and copying contact records into Brevo by hand wastes hours every week.
Trigger
The Gmail trigger runs immediately whenever a new email arrives in the monitored inbox.
Connected systems
- Gmail
- Google Gemini
- Text classifier
- Brevo
- Email sender
- Self-hosted n8n
Every workflow is deployed on your own server with documentation, a run log and an error queue.
Workflow architecture
- 1. Gmail Trigger (Trigger) (connects to Emails from Existing…)
- 2. Text Classifier (AI layer) (connects to GuestPost Inquiry, Youtube Video Inquiry, Send Email)
- 3. Google Gemini Chat Model (AI layer) (connects to Text Classifier)
- 4. GuestPost Inquiry (Service and data) (connects to Mark as Read)
- 5. Youtube Video Inquiry (Service and data) (connects to Mark as Read)
- 6. Send Email (Service and data) (connects to Mark as Read)
- 7. Mark as Read (Service and data) (connects to Apply Label, Create Contact in Brevo)
- 8. Apply Label (Service and data)
- 9. Create Contact in Brevo (Service and data)
- 10. Emails from Existing… (Logic and routing) (connects to Reply)
- 11. Reply (Logic and routing) (connects to Text Classifier)
- Trigger
- AI layer
- Logic and routing
- Service and data
Node positions and directed links are generated from the verified catalogue record.
Workflow steps
- 01
Gmail intake and Gemini classification
Incoming messages enter the Google Gemini text classifier node to identify partnership, media or contract intent.
- 02
Conditional routing and Gmail labelling
Conditional branches isolate active contract emails from standard inquiries, mark threads read and assign matching Gmail labels.
- 03
Brevo contact upsert and response
Sender details upsert into Brevo without duplicating contacts, and the matched response template is dispatched by email.
Error queue and human approval
Built-in state in the catalogue workflow
The verified catalogue workflow contains zero node-level error flags across its 11 functional nodes and 12 connections.
Production layer added by ALTAI
During live deployment, ALTAI adds human draft review for uncertain inquiries, sender allow and block lists and a Brevo API error queue.
Gmail Gemini classification and Brevo sync Frequently asked questions
Yes. In production, the send nodes can switch to Gmail draft creation or add a Slack approval step before anything goes out.
No. The conditional branch detects emails linked to active contracts and excludes them from standard automated responses.
No. The Brevo node uses an upsert operation so existing contact profiles update cleanly instead of duplicating.
Related n8n workflows
Gmail to Todoist email task sync workflow
Compares starred and unread Gmail threads with open Todoist tasks, creates OpenAI summaries with structured actions and closes completed tasks.
NocoDB Kanban AI ticket prioritisation workflow
Classifies form incidents with OpenAI against NocoDB rules, creates Kanban records and runs daily checks for unpicked or overdue tasks via Slack and email.
WhatsApp AI customer support workflow
Checks the 24-hour Meta service window, answers with PostgreSQL conversation memory and reopens expired threads through approved templates.

We write the proposal after we have found the problem together
In a thirty-minute call we listen to how you work and talk through where time and customers are slipping away. If you do not need a digital fix, we will tell you that too.
30 minutes · no preparation needed
The call and the week of discovery are both free.Read the terms