AutomationMart
Home/Browse/AI email classifier & auto-delete for Gmail (SPAM/OFFER cleaner)
n8n

AI email classifier & auto-delete for Gmail (SPAM/OFFER cleaner)

n8nn8n5 modulesv1.0
GmailOpenAI

This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant messages in their Gmail inbox — from cold offers to spammy promotions — and want to automatically filter and delete them using AI. Its main purpose is to scan new emails with the help of OpenAI, classify their content, and automatically delete those considered marketing (OFFER) or junk (SPAM). The result is a cleaner inbox without the need to manually sift through low-value messag

At a glance

AI email classifier & auto-delete for Gmail (SPAM/OFFER cleaner) is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Gmail, OpenAI. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Gmail, OpenAI
Modules
5
Price
Free
Version
v1.0
AI email classifier & auto-delete for Gmail (SPAM/OFFER cleaner) workflow diagram

About this workflow

This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant messages in their Gmail inbox — from cold offers to spammy promotions — and want to automatically filter and delete them using AI. Its main purpose is to scan new emails with the help of OpenAI, classify their content, and automatically delete those considered marketing (OFFER) or junk (SPAM). The result is a cleaner inbox without the need to manually sift through low-value messages. The classification logic uses a detailed system prompt with practical examples, so even complex or borderline messages are categorized accurately. Important emails — such as payment confirmations, shipping updates, or genuine business inquiries — remain untouched. This helps maintain a professional inbox with only valuable and relevant communication. The entire process runs automatically in the background and can be customized further — for example, to archive instead of delete, or log deleted emails for review. How it works When triggered (every hour), the workflow fetches new Gmail messages using the Gmail Trigger node. Each message is passed to an AI classifier powered by OpenAI, which reads the message body (email snippet) and returns one of three labels: SPAM: Obvious junk messages, scams, or low-effort bulk messages OFFER: Cold outreach, discount promotions, cart reminders, or generic advertising IMPORTANT: Valuable information for the user, even if commercial (e.g., invoices, order updates, personal inquiries) The workflow then routes the result through an IF node. If the message is marked as SPAM or OFFER, it is immediately deleted from Gmail via the Gmail Delete node. Emails marked as IMPORTANT are ignored and remain in the inbox. The classification is entirely AI-driven based on message content — sender address, headers, or metadata are not used. How to set up To get started, simply connect two credentials: A Gmail account using OAuth2 (via the Gmail Trigger and Gmail Delete nodes) An OpenAI API key (used by the AI classifier node) No advanced setup is needed beyond these two connections. Optionally, you can review or modify the system prompt used for classification — it’s available inside the workflow’s LangChain AI Agent node. The prompt is in English, so it’s recommended to use this workflow with English-language emails for best results. By default, the workflow deletes matching emails immediately. If you prefer safer testing, you can modify the Gmail node to archive, label, or log emails instead of deleting them. The full workflow takes around 5–10 minutes to configure and includes a sticky note with additional instructions and warnings.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Triage emergency patients via chat with GPT-4.1 and hospital systems

How It Works This workflow automates hospital emergency department triage by intelligently processing patient intake information through multiple AI-powered assessment stages. Designed for emergency departments, urgent care centers, and hospital admission teams, it solves the critical challenge of rapid, accurate patient prioritization during high-volume periods. The system captures initial patient data through a chat interface, uses specialized AI agents to analyze medical history and current s

Free

Automate systematic literature reviews with Google Drive, GPT-4, Gemini, Qdrant and Airtable

How it works - Automates systematic literature review by downloading papers from Google Drive, extracting text, and evaluating them against strict inclusion/exclusion criteria using LLM agents - Routes included papers to Qdrant vector stores with Gemini embeddings for semantic search, and excluded papers to a separate folder - Logs all decisions to Airtable with PRISMA-compliant justification for complete audit trails Set up steps - Connect Google Drive credentials to access your paper folder -

Free

Send pre-meeting attendee context with OpenAI, Google Calendar, and Slack

Overiew This workflow builds an AI meeting assistant who sends information-dense pre-meeting notifications for a user's upcoming meetings. How It Works A scheduled trigger fires hourly and checks for upcoming meetings within the hour. When found, a search for last correspondence + recent activity is performed for each attendee. Using available correspondance, an AI/LLM is used to summarize this information and generate a short notification message which should help the user prepare for the m

Free

Automate document management with Google Docs and a ChatGPT Assistant

Use this template to manage documents by watching Google Docs for changes, retrieving content, generating insights with ChatGPT's Assistant, and creating new documents.

Free

Automate LinkedIn job alerts with J-Search API and SMTP email notifications

Automate LinkedIn Job Alerts with Google Sheets, J-Search (RapidAPI), and SMTP --- Description Fetch LinkedIn-style job listings from the J-Search API using predefined parameters, then deliver a professional HTML job alert digest to your inbox via SMTP. Get actionable “Apply Now” links in your email—no manual searching required. ✉️💼 What This Template Does - Manual Trigger: Initiates the workflow on demand. - Set Preferences: Captures job search parameters (role, date, page count, country, lang

Free

Create AI shorts with HeyGen, Creatomate, Replicate, Gemini and OpenAI

Shorts Creation v10 (Telegram Filming) — n8n Template Description --- How it works This workflow is a fully automated YouTube Shorts production pipeline. It takes the structured output from a video digestion workflow (transcript, key moments, metadata) and produces finished, rendered vertical shorts complete with AI-generated avatar narration, AI-generated B-roll video clips, dynamic multi-layout compositions, social media copy, and a lead magnet document — all uploaded to Google Dri

Free

Generate weekly dinner meal plans and shopping lists using Mealie

This n8n template demonstrates how to automatically generate a full week of dinner meal plans in your self hosted Mealie instance and create a corresponding shopping list based on those planned meals. Perfect for anyone who wants hands off weekly planning. Set it once and let it build your dinners and prep your ingredient data every week. How it works A Schedule Trigger runs once per week to kick things off. A Code node generates the next 7 calendar days starting from today. For each day, we

Free

Scrape Reuters news & send AI summaries with Brightdata, Claude 4 & Telegram

Comprehensive Reuters News Intelligence System With Brightdata & Telegram Alerts A powerful n8n automation workflow that scrapes the latest Reuters news articles using Bright Data's web scraping capabilities and delivers intelligent news summaries directly to your Telegram chat. 📋 Overview This workflow provides an automated news intelligence solution that monitors Reuters for breaking news, analyzes content using Claude AI, and delivers personalized news alerts. Perfect for journalist

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free