What This Workflow Does
This n8n workflow automates the tedious process of cleaning your Gmail inbox by intelligently identifying and removing unwanted emails. Unlike basic filters, it uses Gemini AI to validate whether emails should be deleted based on your custom criteria, ensuring important messages aren't accidentally removed.
The system then sends Telegram notifications about the cleanup actions taken, giving you visibility into what was deleted while keeping your inbox organized automatically. It's designed for professionals who receive high volumes of emails but want to maintain inbox zero without manual effort.
How It Works
1. Email Scanning
The workflow periodically checks your Gmail inbox for new messages matching your predefined criteria (like older than 30 days, from certain senders, or containing specific keywords).
2. AI Validation
Potential candidates for deletion are sent to Gemini AI, which analyzes the email content against your rules to determine if it should be removed. The AI considers context that simple filters might miss.
3. Action Execution
Validated emails are either archived or permanently deleted based on your configuration. The system maintains a log of all actions taken.
4. Telegram Notification
You receive a Telegram message summarizing the cleanup actions, including counts of deleted emails and any potential exceptions the AI flagged for review.
Who This Is For
This automation is ideal for busy professionals, entrepreneurs, and teams who:
- Receive 100+ emails daily
- Struggle with inbox overload
- Want to maintain inbox zero
- Need smarter filtering than Gmail's native tools
- Want visibility into automated email actions
What You'll Need
- An n8n instance (cloud or self-hosted)
- Gmail account with API access enabled
- Google Cloud project with Gemini API enabled
- Telegram account and bot token
- Basic understanding of n8n workflows
Quick Setup Guide
- Download the JSON template file
- Import into your n8n instance
- Configure Gmail OAuth credentials
- Set up your Gemini API key
- Add your Telegram bot token
- Adjust deletion criteria as needed
- Test with a small batch of emails first
- Schedule the workflow to run automatically
Key Benefits
Save 2-5 hours per week by eliminating manual email cleanup while maintaining better organization than simple filters.
Reduce storage costs by automatically removing large attachments and old messages you don't need.
Prevent accidental deletions with AI validation that understands context better than rules-based filters.
Stay informed with Telegram notifications about what was cleaned up, giving you control without effort.
Customizable criteria lets you adapt the system as your email needs change over time.