Auto-label incoming Gmail messages with AI nodes
This workflow uses AI to analyze the content of every new message in Gmail and then assigns specific labels, according to the context of the email. Default c...
🔌 Nodes & Integrations Used (5)
📖 Implementation & Setup Guide
This workflow uses AI to analyze the content of every new message in Gmail and then assigns specific labels, according to the context of the email.
Default configuration of the workflow includes 3 labels: - „Partnership” - email about sponsored content or cooperation, - „Inquiry” - email about products, services, - „Notification” - email that doesn't require response.
You can add or edit labels and descriptions according to your use case.
🎬 See this workflow in action [in my YouTube video](https://youtu.be/a8Dhj3Zh9vQ) about automating Gmail.
How it works?
Gmail trigger performs polling every minute for new messages (you can change the trigger interval according to your needs). The email content is then downloaded and forwarded to an AI chain.
💡 The prompt in the AI chain node includes instructions for applying labels according to the email content - change label names and instructions to fit your use case.
Next, the workflow retrieves all labels from the Gmail account and compares them with the label names returned from the AI chain. Label IDs are aggregated and applied to processed email messages.
⚠️ Label names in the Gmail account and workflow (prompt, JSON schema) must be the same.
Set up steps
- Set credentials for Gmail and OpenAI.
- Add labels to your Gmail account (e.g. „Partnership”, „Inquiry” and „Notification”).
- Change prompt in AI chain node (update list of label names and instructions).
- Change list of available labels in JSON schema in parser node.
- Optionally: change polling interval in Gmail trigger (by default interval is 1 minute).
If you like this workflow, please subscribe to [my YouTube channel](https://www.youtube.com/@workfloows/) and/or [my newsletter](https://workfloows.com/).
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Auto-label incoming Gmail messages with AI nodes.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related Email & Outreach Workflows
View All in Email & Outreach →Abandoned cart recovery for Shopify via Gmail Google Sheets T
Who is this for? This template is ideal for solo store owners, eCommerce marketers, automation beginners, or anyone using Shopify and Gmail who wants to reco...
Add new leads in Lemlist from Airtable
This workflow allows you to add new leads in Lemlist from Airtable. !workflow-screenshot Airtable node: This node lists all the emails that are stored in you...
Add Subscriber and Send Email Campaign
Production-ready n8n automation template for Add Subscriber and Send Email Campaign built by AhiXLight. Seamlessly connects Sendy with 3 configured nodes.
Add new contacts from HubSpot to the email list in Mailchimp
This workflow adds new HubSpot contacts to the Mailchimp email list. Prerequisites - HubSpot account and HubSpot credentials - Mailchimp account and Mailchim...