Limpieza automática de correo no deseado y marketing

Intermedio

Este es unOther, Support, AIflujo de automatización del dominio deautomatización que contiene 6 nodos.Utiliza principalmente nodos como If, Gmail, GmailTrigger, Agent, LmChatOpenAi, combinando tecnología de inteligencia artificial para lograr automatización inteligente. Automatización del filtrado de spam con GPT-4 y Gmail

Requisitos previos
  • Cuenta de Google y credenciales de API de Gmail
  • Clave de API de OpenAI
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "id": "3QJW0AkGeIq3ofcC",
  "meta": {
    "instanceId": "740c1df6d3b1b6ea8a9d2223701f6904173f9e3cf7381cd181644b043420ba09",
    "templateCredsSetupCompleted": true
  },
  "name": "Auto Spam & Marketing Email Killer",
  "tags": [],
  "nodes": [
    {
      "id": "83cad1fb-1c94-4fa6-abc6-fc9084e84b8a",
      "name": "Disparador de Gmail",
      "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": "Modelo de chat OpenAI",
      "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 Correo electrónico",
      "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 Correo electrónico",
      "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": "Nota adhesiva",
      "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
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Intermedio - Otros, Soporte, Inteligencia Artificial

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Intermedio
Número de nodos6
Categoría3
Tipos de nodos6
Descripción de la dificultad

Adecuado para usuarios con experiencia intermedia, flujos de trabajo de complejidad media con 6-15 nodos

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

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34