Intelligent Email Filtering and Automated Cleanup Workflow
This workflow utilizes the Google Gemini AI model to intelligently classify emails in Gmail, automatically identifying and deleting spam and marketing emails, significantly enhancing the efficiency and tidiness of email management. Additionally, it employs Telegram to send instant notifications, providing real-time feedback on processing results, ensuring that users are always aware of their inbox status and reducing the need for manual intervention. It is suitable for both individual and business users for efficient email management.

Workflow Name
Intelligent Email Filtering and Automated Cleanup Workflow
Key Features and Highlights
This workflow leverages the Google Gemini AI model to intelligently categorize emails within Gmail, accurately identifying spam, promotional, and unwanted emails, and automatically executing deletion operations. Additionally, it integrates Telegram instant notifications to provide real-time feedback on processing results and anomalies, ensuring transparent and efficient email management.
Core Problems Addressed
Traditional email management often suffers from an overwhelming accumulation of spam and irrelevant marketing emails, making manual filtering time-consuming and prone to accidental deletion of important messages. This workflow employs AI-driven email classification to automate cleanup processes, significantly enhancing inbox cleanliness and work efficiency while minimizing manual intervention.
Application Scenarios
- Automated cleanup of Gmail inboxes for individual and corporate users
- Email quality monitoring for marketing professionals
- Automated email management for IT operations
- Any scenario requiring efficient and organized email handling
Main Process Steps
- Initialize loop variables, setting time-based pagination parameters for batch email processing.
- Retrieve Gmail emails, filtering messages from the past 14 days while excluding those with specific labels.
- Invoke the Google Gemini AI model to intelligently classify email content, outputting confidence scores and brief rationales for spam, promotional, and unwanted email categories.
- Parse AI output results to structurally process classification data.
- Conditional evaluation based on a confidence threshold (0.5) to determine whether an email is spam or promotional.
- Execute email deletion for emails identified as unwanted.
- Manage email labels by tagging non-deleted emails for subsequent handling.
- Send Telegram notifications for successful deletions, skipped emails, deletion failures, and AI anomalies, ensuring users receive real-time status updates.
- Loop processing to paginate through historical emails, enabling bulk intelligent management.
Involved Systems and Services
- Gmail: Email retrieval, deletion, and label management
- Google Gemini Chat Model (PaLM API): Intelligent email content analysis and classification
- Telegram: Instant messaging notifications to report email processing outcomes
- n8n Automation Platform: Workflow orchestration and task automation
Target Users and Value Proposition
- Individual users seeking efficient Gmail inbox management
- Professionals aiming to automatically filter advertisements and spam
- Corporate email administrators and IT operations personnel
- Automation enthusiasts and engineers pursuing workflow automation to boost productivity
By deeply integrating AI and automation, this workflow delivers intelligent and efficient email management, substantially reducing manual filtering efforts and maintaining a clean, secure inbox environment.