Gmail Email Cleaner with AI Categorization
detail.loadingPreview
Automatically classifies and optionally deletes unwanted, marketing, or spam emails from Gmail using AI.
🚀Ready to Deploy This Workflow?
About This Workflow
Overview
This workflow automates the process of cleaning your Gmail inbox. It fetches emails, uses an AI model (Google Gemini) to categorize them based on whether they are unwanted, marketing, or spam, and then either deletes the identified emails or skips them, sending notifications for each action. It also includes error handling for AI processing and email deletion.
Key Features
- Fetches emails from Gmail.
- Utilizes Google Gemini for AI-powered email classification.
- Assigns confidence scores for unwanted, marketing, and spam categories.
- Provides a brief reason for the classification.
- Deletes emails identified as unwanted, marketing, or spam (confidence > 0.5).
- Skips emails not meeting the deletion criteria.
- Sends Telegram notifications for email deletion, skipping, and AI errors.
How To Use
- Prerequisites: Ensure you have a Gmail account and a Telegram account with API access.
- Install n8n: Set up n8n locally or on a server.
- Configure Credentials: Add your Gmail OAuth2 credentials and Telegram Bot Token.
- Import Workflow: Import the provided JSON into your n8n instance.
- Configure Nodes:
- Gmail Get Email: Set the desired date range for fetching emails. Adjust the
qfilter as needed (e.g., to exclude already processed emails). - Google Gemini Chat Model: Ensure your Google Gemini API credentials are correctly set.
- AI Check Email: The prompt is pre-configured. Review it if you need to adjust the classification logic.
- Unwanted Email Output Parser: The schema is pre-defined. It expects
emailId,isUnwantedConfidence,isMarketingConfidence,isSpamConfidence,briefReason, andemailFrom. - If Unwanted Marketing or Spam: Adjust the
rightValue(currently 0.5) if you want to change the confidence threshold for deletion. - Telegram Nodes: Update
chatIdif you want to send notifications to a different Telegram chat.
- Gmail Get Email: Set the desired date range for fetching emails. Adjust the
- Test Workflow: Click 'Test workflow' to run it and verify the functionality.
- Activate Workflow: Enable the workflow to run automatically based on your schedule.
Apps Used
Workflow JSON
{
"id": "897d4c3b-c899-4d35-b268-638ac1536969",
"name": "Gmail Email Cleaner with AI Categorization",
"nodes": 0,
"category": "Email Management",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 897d4c3b-c899...
About the Author
N8N_Community_Pick
Curator
Hand-picked high quality workflows from the global community.
Statistics
Verification Info
Related Workflows
Discover more workflows you might like
Gmail Starred Email Archiver
Automatically archives all emails in your Gmail inbox except for those you have starred.
Gmail Cleanup and Management
Automates the process of fetching and optionally deleting specific Gmail messages.
Gmail Cleanup and Batch Processing
Automates the retrieval of Gmail message IDs, splits them into batches, and deletes them.
Automate Instagram Reel Analysis with Gemini and Apify
Unlock deeper insights into your Instagram Reels by automating analysis. This workflow leverages Apify to fetch reel data and Gemini AI to dissect key elements like background, pose, text, and context, enabling better content replication.
Telegram Profanity & Toxicity Filter
This n8n workflow automatically monitors incoming Telegram messages for profanity and toxic language. It leverages Google's Perspective API to analyze message content, and if a message is deemed inappropriate, the workflow sends an automated warning response back to the sender.
Automate Shipment Tracking with Telegram and n8n
Streamline your logistics operations by automating shipment tracking with Telegram and n8n. This workflow allows drivers to easily share updates, and ensures timely notifications to your team.