Gmail Automate

Gmail Automate streamlines email management by automatically identifying and deleting unwanted, marketing, or spam emails. This 17-node workflow integrates Gmail, LangChain, and Telegram to enhance productivity, providing real-time notifications for deleted emails and errors. It efficiently processes emails, ensuring a cleaner inbox and reducing distractions.

7/8/2025
17 nodes
Complex
manualcomplexgmaillangchaintelegramnoopaggregateadvancedlogicconditionalcommunicationbot
Categories:
Communication & MessagingComplex WorkflowManual Triggered
Integrations:
GmailLangChainTelegramNoOpAggregate

Target Audience

Target Audience


- Email Marketers: Those who manage large volumes of emails and wish to filter out unwanted marketing content.
- Business Professionals: Individuals who receive numerous emails and need to maintain focus by eliminating distractions.
- Developers: Tech-savvy users looking to automate email management processes using n8n.
- Small Business Owners: Entrepreneurs who want to streamline their email communications and enhance productivity.
- Data Analysts: Professionals interested in analyzing email data for insights and trends.

Problem Solved

Problem Solved


This workflow addresses the challenge of managing overwhelming email volumes by automatically identifying and deleting unwanted emails, including marketing and spam. It leverages AI to classify emails based on their content, providing a confidence score for unwantedness, marketing, and spam. Users receive real-time notifications via Telegram about actions taken on their emails, ensuring they stay informed without needing to constantly check their inbox.

Workflow Steps

Workflow Steps


1. Manual Trigger: The workflow begins when the user clicks the 'Test workflow' button.
2. Initialize Loop Variables: Sets the initial page variable to 0 for pagination purposes.
3. Get Emails from Gmail: Retrieves all emails from Gmail that fall within a specific date range, excluding spam and trash.
4. AI Check Email: Each email is analyzed using the Google Gemini Chat Model, which classifies the email and provides confidence scores for being unwanted, marketing, or spam.
5. Output Parsing: The AI's output is parsed to extract relevant information, including the email ID and classification scores.
6. Conditional Logic: Checks if the email is classified as unwanted, marketing, or spam (confidence > 0.5).
7. Delete or Label Email: If classified as unwanted, the email is deleted. If not, it can be labeled for further review.
8. Notifications via Telegram: Sends notifications to a specified Telegram chat about whether an email was deleted or skipped, including the sender's address and brief reason for the classification.
9. Error Handling: In case of errors during AI processing or email deletion, notifications are sent to Telegram to keep the user informed.

Customization Guide

Customization Guide


- Adjust Email Filters: Modify the Gmail filters in the 'Gmail Get Email' node to change which emails are retrieved based on specific criteria (e.g., sender, subject).
- Change Confidence Thresholds: Alter the thresholds in the 'If Unwanted Marketing or Spam' node to adjust how sensitive the classification is to unwanted emails.
- Modify Telegram Notifications: Customize the message format in the Telegram nodes to include additional details or change the wording of notifications.
- Integrate Additional Services: Add more nodes to connect with other services or databases to enhance the workflow's capabilities, such as logging email data to a spreadsheet for analysis.
- Schedule Workflow: Instead of a manual trigger, set up a schedule to run the workflow automatically at specified intervals (e.g., daily, weekly).