Automatischer Reiniger für Spam- und Marketing-E-Mails

Fortgeschritten

Dies ist ein Other, Support, AI-Bereich Automatisierungsworkflow mit 6 Nodes. Hauptsächlich werden If, Gmail, GmailTrigger, Agent, LmChatOpenAi und andere Nodes verwendet, kombiniert mit KI-Technologie für intelligente Automatisierung. Automatisierung des Spam-Filterings mit GPT-4 und Gmail

Voraussetzungen
  • Google-Konto + Gmail API-Anmeldedaten
  • OpenAI API Key
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
  "id": "3QJW0AkGeIq3ofcC",
  "meta": {
    "instanceId": "740c1df6d3b1b6ea8a9d2223701f6904173f9e3cf7381cd181644b043420ba09",
    "templateCredsSetupCompleted": true
  },
  "name": "Auto Spam & Marketing Email Killer",
  "tags": [],
  "nodes": [
    {
      "id": "83cad1fb-1c94-4fa6-abc6-fc9084e84b8a",
      "name": "Gmail-Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -80,
        60
      ],
      "parameters": {
        "filters": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "ECavbdGSgi3lNgZG",
          "name": "Gmail account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "38c3a768-5152-4377-9fa7-065e58233ef2",
      "name": "OpenAI-Chat-Modell",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        160,
        280
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-nano",
          "cachedResultName": "gpt-4.1-nano"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "69YTGxdIPy79gAdh",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4acc776b-0554-4a74-b10a-5307ee14fee2",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        520,
        60
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "3fa478cd-9476-4a10-b039-1e537b838b31",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.output }}",
              "rightValue": "SPAM"
            },
            {
              "id": "82bafdff-daed-4791-8dd0-dae981c0ee43",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.output }}",
              "rightValue": "OFERTA"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a2440f83-73b8-4757-90cf-c0f4d269eb9b",
      "name": "Validator of E-Mail",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        160,
        60
      ],
      "parameters": {
        "text": "=Your email too check:\n {{ $json.snippet }}",
        "options": {
          "systemMessage": "=You are an intelligent assistant for analyzing and classifying email messages or contact forms.\n\nYour task is to carefully evaluate whether the message contains valuable information, or whether it is a standard marketing message with no real value to the recipient.\n\nWe distinguish three classes:\n\nSPAM – bulk messages, low-quality content, random text, scams, phishing, etc.\n\nOFFER – commercial or marketing messages that promote something but do not contain important information for the user, e.g.:\n\nDiscount coupons\n\nPromotion or sale notifications\n\nAbandoned cart reminders\n\nEncouragement to sign up, download, or buy\n\nCold emails and collaboration offers\n\nIMPORTANT – messages containing valuable or relevant information for the recipient, even if commercial in nature, e.g.:\n\nOrder or payment confirmation\n\nShipping or delivery status updates\n\nMessage from a specific person with a question or request\n\nPersonal matters, invitations, inquiries\n\nRules:\n\nIf you're unsure, better to classify as IMPORTANT.\n\nFocus on the message content, do not judge by the email address or headers.\n\nRespond with only one word: SPAM, OFFER, or IMPORTANT.\n\nExamples:\n\nMessage:\n“Your order #14235 has been shipped. Estimated delivery: Thursday.”\nAnswer: IMPORTANT\n📌 This is relevant information for the user – do not remove.\n\nMessage:\n“You left something in your cart! Only today –15% off your purchase!”\nAnswer: OFFER\n📌 Typical marketing reminder, no actual value.\n\nMessage:\n“Hi, we noticed you didn’t download our free e-book. Download now to discover 10 ways to boost sales.”\nAnswer: OFFER\n📌 Marketing prompt, lacks valuable content.\n\nMessage:\n“Attached is the invoice for the service completed last month. Please contact me with any questions.”\nAnswer: IMPORTANT\n📌 Invoice = important message.\n\nMessage:\n“Today only! Free shipping and discounts up to 30% in our store!”\nAnswer: OFFER\n📌 Promotion, typical sales message.\n\nMessage:\n“Hi, I saw your listing online and I’m interested in working with you. Can we talk by phone?”\nAnswer: IMPORTANT\n📌 Message from a real person = potential lead.\n\nMessage:\n“Win a new iPhone! Click here to claim your prize!”\nAnswer: SPAM\n📌 No need to explain – scam/spam.\n\nMessage:\n“I’d like to ask if you offer individual training sessions?”\nAnswer: IMPORTANT\n📌 A real inquiry from a potential customer.\n\nMessage:\n“Register now for free 7-day access to XYZ tool.”\nAnswer: OFFER\n📌 Advertising offer, not inherently important."
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "77b25fbd-4093-48d1-9230-6a765d60b928",
      "name": "Delete E-Mail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        760,
        60
      ],
      "webhookId": "8c6da755-63e5-43e6-a22b-c189a72e7e7b",
      "parameters": {
        "messageId": "={{ $('Gmail Trigger').item.json.id }}",
        "operation": "delete"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "ECavbdGSgi3lNgZG",
          "name": "Gmail account 2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "a994bc19-d3fd-43b0-8612-bb9dfdceff08",
      "name": "Haftnotiz",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        40
      ],
      "parameters": {
        "width": 560,
        "height": 660,
        "content": "## 🧹 Auto Spam & Marketing Email Killer\n\nTired of promotional clutter in your inbox?  \nThis AI-powered n8n workflow automatically scans your Gmail inbox every hour, analyzes incoming messages using GPT-4, and deletes unwanted emails labeled as **SPAM** or **OFERR**.\n\n### 🔍 What it does\n- Triggers on new Gmail messages\n- Uses OpenAI to classify the message as: `IMPORTANT`, `OFFER`, or `SPAM`\n- Deletes emails marked as `SPAM` or `OFFER`\n- Keeps important messages like order confirmations, invoices, and personal inquiries\n\n### 🤖 Built-in Intelligence\nThe AI agent is trained with 9 real examples to ensure precise classification of marketing emails, phishing, cold outreach, and more.\n\n### 📦 Ideal for:\n- Solopreneurs\n- Business inboxes\n- Clean-inbox enthusiasts\n\nSet it once, and enjoy a distraction-free email experience.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0bbcd957-fdb2-4d3d-ac6b-f25903bbe301",
  "connections": {
    "4acc776b-0554-4a74-b10a-5307ee14fee2": {
      "main": [
        [
          {
            "node": "Delete Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Validator of Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Validator of Email",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Validator of Email": {
      "main": [
        [
          {
            "node": "4acc776b-0554-4a74-b10a-5307ee14fee2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Häufig gestellte Fragen

Wie verwende ich diesen Workflow?

Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.

Für welche Szenarien ist dieser Workflow geeignet?

Fortgeschritten - Sonstiges, Support, Künstliche Intelligenz

Ist es kostenpflichtig?

Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.

Workflow-Informationen
Schwierigkeitsgrad
Fortgeschritten
Anzahl der Nodes6
Kategorie3
Node-Typen6
Schwierigkeitsbeschreibung

Für erfahrene Benutzer, mittelkomplexe Workflows mit 6-15 Nodes

Autor
LukaszB

LukaszB

@lukaszb

AI Automation Expert | Web & Mobile App Integrator With 2+ years of experience, I build smart automations, web & mobile app workflows, and scalable platforms using tools like n8n, Make, and more. I help businesses reduce operational costs, save time, and scale faster with AI-powered solutions. For business enquiries, send me an email at kontakt@lumizone.pl

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34