{
  "name": "Bulk delete Slack messages with smart filtering and confirmations",
  "nodes": [
    {
      "id": "975ba945-ce00-45e2-bf2a-aeaf3f1d5012",
      "name": "Parse Command",
      "type": "n8n-nodes-base.code",
      "position": [
        -420,
        560
      ]
    },
    {
      "id": "81524a01-a9b4-4802-911a-c32e1ed9b62b",
      "name": "Check if Valid Command",
      "type": "n8n-nodes-base.if",
      "position": [
        20,
        560
      ]
    },
    {
      "id": "ad2945c8-87c9-47d0-a1bf-a6629c895a96",
      "name": "Send Error Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        920,
        760
      ]
    },
    {
      "id": "1a951ca1-f0de-49d8-8ea4-40b28770f9c4",
      "name": "Get Channel Messages",
      "type": "n8n-nodes-base.slack",
      "position": [
        260,
        340
      ]
    },
    {
      "id": "62a04f05-8788-47ce-b493-38b9548af0fe",
      "name": "Filter Messages by Search Term",
      "type": "n8n-nodes-base.code",
      "position": [
        480,
        340
      ]
    },
    {
      "id": "e6901c01-faef-47ad-834d-de3e033d9660",
      "name": "Messages Found?",
      "type": "n8n-nodes-base.if",
      "position": [
        700,
        340
      ]
    },
    {
      "id": "67ce1fe7-1f65-42d9-8e2a-1ede6b0bb72c",
      "name": "No Messages Found",
      "type": "n8n-nodes-base.slack",
      "position": [
        920,
        560
      ]
    },
    {
      "id": "6b243ff0-cda8-4143-add1-98da19dcd5e0",
      "name": "Send Confirmation Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        920,
        320
      ]
    },
    {
      "id": "0af3cb87-ad7d-4490-bc60-c499fb0b6be0",
      "name": "Store Pending Deletion",
      "type": "n8n-nodes-base.code",
      "position": [
        920,
        120
      ]
    },
    {
      "id": "84440246-0f59-421b-9560-4c00d988cb4c",
      "name": "Delete or Cancel?",
      "type": "n8n-nodes-base.if",
      "position": [
        920,
        -80
      ]
    },
    {
      "id": "54662021-94f7-472d-beb8-72613de271d9",
      "name": "Send Cancel Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        1360,
        120
      ]
    },
    {
      "id": "ad54dbb5-ac41-490a-bf8f-a8e1e59d6611",
      "name": "Loop Over Messages",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2460,
        -100
      ]
    },
    {
      "id": "48d391e8-1da3-4678-b0b2-169b41cde1d0",
      "name": "Wait Between Deletes",
      "type": "n8n-nodes-base.wait",
      "position": [
        2680,
        -320
      ]
    },
    {
      "id": "87514904-52f8-40e9-aaa5-13364d8a723d",
      "name": "Delete Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        2880,
        -80
      ]
    },
    {
      "id": "02333851-d886-4630-a9d9-aa533ae7564b",
      "name": "Send Completion Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        3140,
        200
      ]
    },
    {
      "id": "124261cc-8a44-4af5-b8b5-424e723ef7ee",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1140,
        200
      ]
    },
    {
      "id": "bed31a19-8a09-4ab7-865e-ae866e85fc6c",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.code",
      "position": [
        -920,
        200
      ]
    },
    {
      "id": "aba0cf53-473b-46cb-aa85-4052ec4209d3",
      "name": "Check User Message",
      "type": "n8n-nodes-base.code",
      "position": [
        -400,
        -60
      ]
    },
    {
      "id": "2b162d2a-8790-407f-8f2f-e547d33a4bdf",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        480,
        -60
      ]
    },
    {
      "id": "a222e7a4-759a-4be7-9912-cbf7e54f51ad",
      "name": "Code Count",
      "type": "n8n-nodes-base.code",
      "position": [
        2880,
        200
      ]
    },
    {
      "id": "ecf4fa44-d4dd-4066-8c5c-6a82bf017e8e",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        3320,
        200
      ]
    },
    {
      "id": "cf27d860-29c1-4bb5-8583-942ef869c0dd",
      "name": "Error Report",
      "type": "n8n-nodes-base.slack",
      "position": [
        260,
        120
      ]
    },
    {
      "id": "248ebe61-01d9-41ca-9aee-719610851817",
      "name": "Prase Set",
      "type": "n8n-nodes-base.set",
      "position": [
        -200,
        560
      ]
    },
    {
      "id": "205c94b7-64db-48ef-8344-119e75fc2be4",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -720,
        200
      ]
    },
    {
      "id": "8d01fdc2-8ff4-4e72-8b7b-3d3e70523516",
      "name": "Clean Up Workflow Messages",
      "type": "n8n-nodes-base.code",
      "position": [
        3540,
        200
      ]
    },
    {
      "id": "4b6f64dd-55a6-49e4-89d9-42cc259d3e6e",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3760,
        200
      ]
    },
    {
      "id": "47feca47-9d1e-4e0b-8fc0-74f90a16b89b",
      "name": "Delete Workflow Messages",
      "type": "n8n-nodes-base.slack",
      "position": [
        4020,
        220
      ]
    },
    {
      "id": "6817ed58-23c9-4429-8783-7bdc0a14ca47",
      "name": "Delete Error Final",
      "type": "n8n-nodes-base.slack",
      "position": [
        3540,
        -80
      ]
    },
    {
      "id": "db924753-78c2-4e64-844c-828b8f044977",
      "name": "Wait for Error Final",
      "type": "n8n-nodes-base.wait",
      "position": [
        3320,
        -80
      ]
    },
    {
      "id": "ecb2798a-644f-4d39-85c1-41d4f2622d7f",
      "name": "Post Error Final",
      "type": "n8n-nodes-base.slack",
      "position": [
        3140,
        -80
      ]
    },
    {
      "id": "82ce2cda-85e8-4da1-99ed-32e983e79b10",
      "name": "Wait Error Final",
      "type": "n8n-nodes-base.wait",
      "position": [
        1140,
        760
      ]
    },
    {
      "id": "cf7be54f-24f8-4f14-bec6-aa96c8df9697",
      "name": "Delete Error Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        1360,
        760
      ]
    },
    {
      "id": "2e876cef-2e33-411f-ae48-ed858c0210a4",
      "name": "Wait No.M Final",
      "type": "n8n-nodes-base.wait",
      "position": [
        1140,
        560
      ]
    },
    {
      "id": "8dc45a00-8f8e-4e37-b864-6f4801170a9c",
      "name": "Delete No Messages",
      "type": "n8n-nodes-base.slack",
      "position": [
        1360,
        560
      ]
    },
    {
      "id": "eaf0836a-9c73-43f7-a4bc-1eae0bd64a4b",
      "name": "Wait Cancel Message",
      "type": "n8n-nodes-base.wait",
      "position": [
        1600,
        120
      ]
    },
    {
      "id": "4d1e3c2e-caa2-4be3-a92f-8611eca28c9d",
      "name": "Delete Cancel Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        1860,
        120
      ]
    },
    {
      "id": "76db469f-e16e-4e49-8561-f6851b07ab9b",
      "name": "Wait Error Report",
      "type": "n8n-nodes-base.wait",
      "position": [
        480,
        120
      ]
    },
    {
      "id": "0c1ced79-46a3-4a1e-a43c-65ae087c4d03",
      "name": "Delete Report Error",
      "type": "n8n-nodes-base.slack",
      "position": [
        700,
        120
      ]
    },
    {
      "id": "fe88f35c-ea43-46b8-8a48-4cf93e264a09",
      "name": "Delete Progress M",
      "type": "n8n-nodes-base.slack",
      "position": [
        1860,
        -300
      ]
    },
    {
      "id": "1d4d0393-c8c6-4959-83b1-f181911fef07",
      "name": "Wait Progress M",
      "type": "n8n-nodes-base.wait",
      "position": [
        1600,
        -300
      ]
    },
    {
      "id": "79d270f1-c453-420d-a64a-a360617bc795",
      "name": "Send Progress Confirmation",
      "type": "n8n-nodes-base.slack",
      "position": [
        1360,
        -300
      ]
    },
    {
      "id": "0bd521fc-9b23-41bf-961e-60343513c7b3",
      "name": "Wait Conf",
      "type": "n8n-nodes-base.wait",
      "position": [
        1140,
        320
      ]
    },
    {
      "id": "a231a659-2584-4ac6-91fa-238d4faf7744",
      "name": "Delete Conf",
      "type": "n8n-nodes-base.slack",
      "position": [
        1360,
        320
      ]
    },
    {
      "id": "8df0723f-8aae-4893-b2da-f17c45becabe",
      "name": "Instruction Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        -400,
        200
      ]
    },
    {
      "id": "2a47706f-1a44-475a-8e9a-e47218fa5d07",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        -180,
        200
      ]
    },
    {
      "id": "021c1e19-7f47-4c30-b916-e9ff0c39e033",
      "name": "Delete Instruction",
      "type": "n8n-nodes-base.slack",
      "position": [
        40,
        200
      ]
    },
    {
      "id": "5c706b73-877f-441a-b218-eeaa5dcb2fd0",
      "name": "Store Message Info",
      "type": "n8n-nodes-base.code",
      "position": [
        2340,
        -300
      ]
    },
    {
      "id": "c13388fe-0cc0-4651-87cd-c186a9516d55",
      "name": "Prepare Messages for Deletion Node",
      "type": "n8n-nodes-base.code",
      "position": [
        2120,
        -300
      ]
    }
  ],
  "connections": {
    "If1": {
      "main": [
        [
          {
            "node": "Delete or Cancel?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Cancel Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Clean Up Workflow Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Delete Instruction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Check User Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Instruction Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Parse Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prase Set": {
      "main": [
        [
          {
            "node": "Check if Valid Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Conf": {
      "main": [
        [
          {
            "node": "Delete Conf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code Count": {
      "main": [
        [
          {
            "node": "Send Completion Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Report": {
      "main": [
        [
          {
            "node": "Wait Error Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Command": {
      "main": [
        [
          {
            "node": "Prase Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Message": {
      "main": [
        [
          {
            "node": "Loop Over Messages",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Post Error Final",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Delete Workflow Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Messages Found?": {
      "main": [
        [
          {
            "node": "Store Pending Deletion",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Confirmation Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Messages Found",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait No.M Final": {
      "main": [
        [
          {
            "node": "Delete No Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Progress M": {
      "main": [
        [
          {
            "node": "Delete Progress M",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Error Final": {
      "main": [
        [
          {
            "node": "Wait for Error Final",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Error Final": {
      "main": [
        [
          {
            "node": "Delete Error Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete or Cancel?": {
      "main": [
        [
          {
            "node": "Loop Over Messages",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Progress Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Messages Found": {
      "main": [
        [
          {
            "node": "Wait No.M Final",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Error Report": {
      "main": [
        [
          {
            "node": "Delete Report Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check User Message": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Error Final": {
      "main": [
        []
      ]
    },
    "Loop Over Messages": {
      "main": [
        [
          {
            "node": "Code Count",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Between Deletes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond to Webhook": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Error Message": {
      "main": [
        [
          {
            "node": "Wait Error Final",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instruction Message": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Cancel Message": {
      "main": [
        [
          {
            "node": "Wait Cancel Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Cancel Message": {
      "main": [
        [
          {
            "node": "Delete Cancel Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Channel Messages": {
      "main": [
        [
          {
            "node": "Filter Messages by Search Term",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Between Deletes": {
      "main": [
        [
          {
            "node": "Delete Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Error Final": {
      "main": [
        [
          {
            "node": "Delete Error Final",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Valid Command": {
      "main": [
        [
          {
            "node": "Get Channel Messages",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Error Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Pending Deletion": {
      "main": [
        []
      ]
    },
    "Send Completion Message": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Workflow Messages": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Send Confirmation Message": {
      "main": [
        [
          {
            "node": "Wait Conf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Up Workflow Messages": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Progress Confirmation": {
      "main": [
        [
          {
            "node": "Wait Progress M",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Messages by Search Term": {
      "main": [
        [
          {
            "node": "Messages Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Messages for Deletion Node": {
      "main": [
        [
          {
            "node": "Store Message Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}