Automate AI-Powered Gmail Inbox Cleanup & Notifications
Automatically manage and filter unwanted emails, reducing manual inbox management by up to 90% and freeing up hours weekly.
Overwhelmed by unwanted emails, marketing promotions, and spam that clutter your inbox and waste valuable time? This workflow intelligently classifies incoming and historical Gmail messages using AI, automatically deleting or labeling them while providing real-time Telegram notifications, drastically reducing manual inbox management.

Documentation
AI-Powered Gmail Inbox Cleaner
This workflow revolutionizes your Gmail experience by automatically identifying and managing unwanted, marketing, and spam emails. Leveraging advanced AI classification and automated actions, it keeps your inbox clean, organized, and focused on what truly matters.
Key Features
- AI-driven email classification: Intelligently identifies unwanted, marketing, and spam emails with confidence scores using Google Gemini.
- Automated email management: Automatically deletes or labels unwanted emails based on AI classification thresholds.
- Real-time Telegram notifications: Stay informed with instant alerts on email actions, including deletions, skips, or AI processing errors.
- Historical inbox decluttering: Efficiently processes past emails in 14-day chunks, ensuring a clean inbox for years.
How It Works
This workflow initiates a loop to process your Gmail inbox in 14-day historical chunks, starting from the most recent emails and working backwards. For each chunk, it retrieves emails, skipping those previously marked as 'n8n-skipped'. Each retrieved email is then sent to an AI agent, powered by Google Gemini, which classifies it with confidence scores for being unwanted, marketing, or spam, and provides a brief reason. An output parser standardizes the AI's response. A conditional check then evaluates these confidence scores: if any exceed 0.5, the email is identified as unwanted. If unwanted, the email is automatically deleted from Gmail, and a notification is sent to your Telegram chat (along with an error notification if deletion fails). If the email is deemed wanted, it is labeled 'n8n-skipped' in Gmail to prevent re-processing in future runs, and a corresponding Telegram notification is sent. Any errors during the AI classification process also trigger a Telegram notification, ensuring you are always aware of your inbox's status. The workflow then iterates to the next 14-day historical period, systematically decluttering your entire email history.