Skip to main content

Smart Gmail cleaner with AI validator & Telegram alerts

Workflow preview

Workflow preview
100%
Smart Gmail cleaner with AI validator & Telegram alerts preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Automatically clean up your Gmail inbox by deleting unwanted emails, validated by Gemini AI. Ideal for anyone tired of manual inbox cleanup, this workflow helps you save time while staying in contr...

Best for

  • Personal Productivity automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmail, n8n-nodes-base.manualtrigger, @n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.if, n8n-nodes-base.telegram, n8n-nodes-base.noop

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Reyhan.

Original n8n.io source

1.1 Workflow description

Title
Smart Gmail cleaner with AI validator & Telegram alerts
Workflow name
Smart Gmail cleaner with AI validator & Telegram alerts

Automatically clean up your Gmail inbox by deleting unwanted emails, validated by Gemini AI.
Ideal for anyone tired of manual inbox cleanup, this workflow helps you save time while staying in control, with full transparency via Telegram alerts.

How it works

  • Scans Gmail inbox in adjustable 2-week batches
  • Uses Gemini AI to decide if an email should be deleted or skipped
  • Applies a label to skipped emails to avoid rechecking in future runs
  • Deletes unwanted emails and sends a Telegram message with the AI's reasoning
  • Also notifies on skipped emails, with explanation included

Set up steps

  1. Connect your Gmail, Gemini AI, and Telegram accounts
  2. Adjust the AI baseline to control sensitivity (e.g. how strict the filtering should be)
  3. Set your batch range (default: last 2 weeks, adjustable)
  4. Define your Telegram chat/channel for notifications

Note: Thanks to n8n's modular design, you can easily switch Gemini for another AI model (like OpenAI, Claude, etc.) or replace Telegram with Discord, Slack, or even email, no code changes needed, just swap the nodes.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Gmail Get Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 2 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 3 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 4 - GmailDeleteEmail

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 5 - AI Check Email

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 6 - Unwanted Email Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 7 - If Unwanted Marketing or Spam

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 8 - Telegram Sent Email Deleted Notification

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 9 - Telegram Sent Email Not Deleted Notification

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 10 - Telegram Sent AI Error Notification

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 11 - Telegram Sent Delete Email Failed Notification

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 12 - Success

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 13 - Increment Loop Var

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - Forward Prev Page Num

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 15 - Initialize Loop Vars

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 16 - Aggregate

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 17 - Gmail

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

3. Summary Table

Workflow Smart Gmail cleaner with AI validator & Telegram alerts
Complexity advanced
Nodes 17
Categories Personal Productivity, AI Summarization
Author Reyhan
Published 09 Apr 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3502/3502.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Smart Gmail cleaner with AI validator & Telegram alerts do?

Automatically clean up your Gmail inbox by deleting unwanted emails, validated by Gemini AI. Ideal for anyone tired of manual inbox cleanup, this workflow helps you save time while staying in contr...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity, AI Summarization use case.