{
  "name": "Smart Gmail cleaner with AI validator & Telegram alerts",
  "nodes": [
    {
      "id": "e205a1ba-9606-457f-9a2f-d433766b3786",
      "name": "Gmail Get Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        60,
        840
      ]
    },
    {
      "id": "380f6e02-7f74-44e4-9229-4784f2f0c66f",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -600,
        965
      ]
    },
    {
      "id": "8acc6bc1-c82e-4c1c-a3b0-dd6cb75cf8c3",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        308,
        1060
      ]
    },
    {
      "id": "f067e64d-bf43-4961-82ff-dcc8ce398375",
      "name": "GmailDeleteEmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        876,
        640
      ]
    },
    {
      "id": "5840c9c6-7afc-4ca1-a8d2-5d0b86339a58",
      "name": "AI Check Email",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        280,
        840
      ]
    },
    {
      "id": "e10f96ce-0a92-4817-b340-0d284039a212",
      "name": "Unwanted Email Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        428,
        1060
      ]
    },
    {
      "id": "796a0d3e-a1e9-4b2c-8f9c-32466c046d22",
      "name": "If Unwanted Marketing or Spam",
      "type": "n8n-nodes-base.if",
      "position": [
        656,
        740
      ]
    },
    {
      "id": "44a68cfc-b1c7-49c1-b268-42810fcd3eeb",
      "name": "Telegram Sent Email Deleted Notification",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1096,
        740
      ]
    },
    {
      "id": "01dee5a4-2ba7-4606-98d8-88914621be48",
      "name": "Telegram Sent Email Not Deleted Notification",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1096,
        940
      ]
    },
    {
      "id": "03292140-5f20-42e8-8d2f-e07a0621844c",
      "name": "Telegram Sent AI Error Notification",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1096,
        1140
      ]
    },
    {
      "id": "cec5d43c-0e06-45a2-b7bc-f943ef205496",
      "name": "Telegram Sent Delete Email Failed Notification",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1096,
        540
      ]
    },
    {
      "id": "bad2dbcc-be22-4470-9b69-06c37929fe65",
      "name": "Success",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1316,
        840
      ]
    },
    {
      "id": "1c38ad6f-ef9c-4e34-8b5e-a6d94ddbd221",
      "name": "Increment Loop Var",
      "type": "n8n-nodes-base.set",
      "position": [
        -160,
        840
      ]
    },
    {
      "id": "66afc6b4-f36f-4564-bb77-b8da9e35331a",
      "name": "Forward Prev Page Num",
      "type": "n8n-nodes-base.set",
      "position": [
        1756,
        1065
      ]
    },
    {
      "id": "6ab44236-17fa-4790-82b5-a0db8f051d19",
      "name": "Initialize Loop Vars",
      "type": "n8n-nodes-base.set",
      "position": [
        -380,
        965
      ]
    },
    {
      "id": "04432130-1a36-4776-9c87-07e935990310",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1536,
        840
      ]
    },
    {
      "id": "73fae867-dc79-43e0-80c8-8f60c7e5a8f4",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        876,
        940
      ]
    }
  ],
  "connections": {
    "Gmail": {
      "main": [
        [
          {
            "node": "Telegram Sent Email Not Deleted Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Success": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Forward Prev Page Num",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Check Email": {
      "main": [
        [
          {
            "node": "If Unwanted Marketing or Spam",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram Sent AI Error Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Get Email": {
      "main": [
        [
          {
            "node": "AI Check Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GmailDeleteEmail": {
      "main": [
        [
          {
            "node": "Telegram Sent Email Deleted Notification",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram Sent Delete Email Failed Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Increment Loop Var": {
      "main": [
        [
          {
            "node": "Gmail Get Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialize Loop Vars": {
      "main": [
        [
          {
            "node": "Increment Loop Var",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Forward Prev Page Num": {
      "main": [
        [
          {
            "node": "Initialize Loop Vars",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Check Email",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Unwanted Email Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Check Email",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "If Unwanted Marketing or Spam": {
      "main": [
        [
          {
            "node": "GmailDeleteEmail",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Initialize Loop Vars",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Sent AI Error Notification": {
      "main": [
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Sent Email Deleted Notification": {
      "main": [
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Sent Email Not Deleted Notification": {
      "main": [
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Sent Delete Email Failed Notification": {
      "main": [
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}