AI-Powered Gmail Spam & Marketing Filter

September 25, 2025

Aladuddin Aladin

This workflow automatically monitors your Gmail inbox, classifies incoming emails using an AI model, and handles unwanted emails (such as marketing, promotions, and spam) by deleting or labeling them. It provides real-time Telegram notifications for every action — whether an email is deleted, skipped, or if an error occurs — ensuring you always stay informed without manually sorting through clutter.

Features

  1. Automated Gmail Processing – Retrieves batches of emails using a paginated loop, covering past messages based on a rolling date range.
  1. AI-Based Email Classification – Uses Google Gemini (PaLM) to analyze each email with confidence scores for unwanted, marketing, and spam content.
  1. Conditional Email Handling – Deletes or labels emails when classification confidence exceeds the configured threshold.
  1. Real-Time Telegram Alerts – Sends immediate Telegram messages for deleted emails, skipped messages, failed deletions, and AI errors.
  1. Safe Fallback Logic – Continues gracefully on errors and provides detailed reasoning for classification decisions.
  1. Scalable Looping – Supports multi-page processing for handling large inboxes over time.
  1. Security-Aware Filtering – System alerts are handled cautiously, keeping only those essential for security (e.g., login or device activity).

About the author

Alauddin Aladin is an AI Automation expert helping businesses streamline operations, boost productivity, and scale effortlessly using tools like Make.com and n8n. With over a decade of experience in digital systems and automation strategy, Alauddin empowers entrepreneurs to save time and grow smarter through intelligent workflows and AI-driven solutions.

Leave a Comment