Workflow Diagram
Tip: CTRL + Mouse wheel to zoom, click and drag to pan
Gmail AI Email Assistant n8n Template
This workflow creates an intelligent email management system that monitors your Gmail inbox and uses AI to automatically categorize incoming emails. The assistant analyzes each email's content and applies appropriate labels and actions based on customizable rules, helping you prioritize important messages and reduce inbox clutter without manual sorting.
How It Works
- The workflow monitors your Gmail inbox for new incoming emails using the Gmail Trigger node.
- When a new email arrives, the workflow extracts the sender information, subject line, and message content.
- This information is passed to an AI agent powered by Anthropic's Claude model, which analyzes the email against your predefined rules.
- Based on the AI's classification, the email is automatically:
- Labeled as "Newsletter" for mass communications
- Marked as "Spam" for unsolicited sales messages
- Tagged as "Potential Lead" for business inquiries
- Starred for important messages requiring attention
- The classification rules are fully customizable in the Set Data node, allowing you to define what constitutes newsletters, spam, and potential leads based on your specific needs.
Benefits
- Save time by eliminating manual email sorting and prioritization
- Reduce inbox clutter by automatically categorizing newsletters and spam
- Never miss important messages with intelligent starring of priority emails
- Identify business opportunities by highlighting potential leads
- Customize classification rules to match your specific email patterns and priorities
- Improve over time by adjusting rules based on performance
Requirements
- n8n account with access to the Gmail and Anthropic integrations
- Gmail account with OAuth2 credentials
- Anthropic API key (Claude model access)
- Gmail labels set up for "Newsletter" and "Potential Lead" categories
Setup Instructions
- Import the workflow JSON file into your n8n instance.
- Set up a Gmail OAuth2 credential by following the n8n documentation guide. Assign this credential to the Gmail Trigger node and all Gmail Tool nodes.
- Create an Anthropic API credential following the Anthropic integration guide and assign it to the Anthropic Chat Model node.
- In the Set Data node, update the "About" field with your personal information and the "Rules" field with your preferred email classification criteria.
- Create the required Gmail labels in your Gmail account that match the label IDs used in the workflow (or update the workflow to use your existing labels).
- Activate the workflow to begin monitoring your inbox.
- Monitor the workflow's performance and adjust the rules as needed to improve classification accuracy.