{
  "name": "Auto-Delete SPAM, Social, and Promotions Emails in Gmail",
  "nodes": [
    {
      "id": "8a921410-15a0-4b0e-9104-19ffa1dd51d0",
      "name": "Delete All Mails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        320,
        500
      ]
    },
    {
      "id": "0b0fe192-6ead-4011-b469-79da8f8033ff",
      "name": "Adjustments",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        120
      ],
      "parameters": {
        "width": 500,
        "height": 740,
        "content": "## 📧 Gmail Setup\n1. Make sure all Gmail nodes use valid and connected Gmail OAuth2 credentials.\n2. To delete different email categories, adjust the labels in each Gmail node:\n   - 'Get all SPAM emails"
      }
    },
    {
      "id": "b4e2ca40-3850-478f-b78d-b6814353a68a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1220,
        360
      ],
      "parameters": {
        "width": 360,
        "height": 240,
        "content": "## ⏰ Scheduled Trigger\n- This workflow runs automatically every 3 days.\n- You can change the interval in the \"Trigger Every Three Days\" node to suit your needs.\n"
      }
    },
    {
      "id": "25bb2611-3188-478b-ac6d-23ed621b4d50",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        360
      ],
      "parameters": {
        "width": 420,
        "height": 240,
        "content": "## 🔀 Merge & Prepare IDs\n- The \"Merge\" node combines results from all three Gmail nodes (SPAM, Social, Promotions).\n- \"Split Out\" node splits the list so each email ID can be processed individually.\n"
      }
    },
    {
      "id": "1393ff41-bafd-437c-877f-be9e62c109c0",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        360
      ],
      "parameters": {
        "width": 420,
        "height": 240,
        "content": "## 🗑️ Delete Emails\n- The \"Delete All Mails\" node deletes emails using their message IDs.\n- Double-check the labels in earlier steps to avoid accidentally deleting important emails.\n"
      }
    },
    {
      "id": "cbbbaf18-29e4-4a97-8614-3dfeeced42a7",
      "name": "Run Every 3 Days (Trigger)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -960,
        500
      ]
    },
    {
      "id": "ecc3647d-f81c-4605-8f66-2a47d20b7dde",
      "name": "Fetch SPAM Emails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -540,
        320
      ]
    },
    {
      "id": "4a288d12-0fb4-44aa-9c41-242cae4f5dd6",
      "name": "Fetch Social Emails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -540,
        500
      ]
    },
    {
      "id": "f65f55af-3374-42fd-98fe-2cfd543077a5",
      "name": "Fetch Promotion Emails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -540,
        680
      ]
    },
    {
      "id": "5b1f0245-960c-4c38-a3c9-8545f7838836",
      "name": "Combine All Fetched Emails",
      "type": "n8n-nodes-base.merge",
      "position": [
        -160,
        500
      ]
    },
    {
      "id": "f97101f1-592e-4295-b3f1-a632a5a15551",
      "name": "Split Email IDs (One per item)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        40,
        500
      ]
    },
    {
      "id": "8d354e0a-0d21-4446-8b58-3d86eb5fbc8d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        700
      ],
      "parameters": {
        "width": 420,
        "height": 240,
        "content": "## ☕ Hey, this tool is totally free!\n\nIf you have any suggestions, feedback, or just wanna say hi — feel free to[reach out](https://khmuhtadin.com).\n\nWanna support my caffeine needs? [Buy me a coffee]"
      }
    }
  ],
  "connections": {
    "Delete All Mails": {
      "main": [
        []
      ]
    },
    "Fetch SPAM Emails": {
      "main": [
        [
          {
            "node": "Combine All Fetched Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Social Emails": {
      "main": [
        [
          {
            "node": "Combine All Fetched Emails",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Fetch Promotion Emails": {
      "main": [
        [
          {
            "node": "Combine All Fetched Emails",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Combine All Fetched Emails": {
      "main": [
        [
          {
            "node": "Split Email IDs (One per item)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Every 3 Days (Trigger)": {
      "main": [
        [
          {
            "node": "Fetch SPAM Emails",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Social Emails",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Promotion Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Email IDs (One per item)": {
      "main": [
        [
          {
            "node": "Delete All Mails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}