{
  "name": "Nightly Discord channel cleanup",
  "nodes": [
    {
      "id": "dde530b8-edd5-4f1d-a3c8-326925c97269",
      "name": "Loop Over Channels",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        560,
        400
      ]
    },
    {
      "id": "3e2684b1-08ad-41bd-930f-cbb229e16617",
      "name": "Loop Over Messages",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1260,
        320
      ]
    },
    {
      "id": "430d13be-670f-4e5d-acdf-ffe1a65a49e3",
      "name": "Every day at 9pm",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -160,
        400
      ]
    },
    {
      "id": "6d40f036-c87a-4b68-9ec6-523a3372447c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        600
      ],
      "parameters": {
        "width": 294,
        "height": 80,
        "content": "**Note ☝️**\nDon’t forget to setup an error workflow to get notified if something goes wrong"
      }
    },
    {
      "id": "93290300-084b-4f91-95bc-f34c1aef93cd",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        -60
      ],
      "parameters": {
        "width": 327,
        "height": 152,
        "content": "### 👨‍🎤 Setup\n1. Add your **Discord** credentials\n2. Change the server in each **Discord** node to the correct one\n3. Click the Test Workflow button\n3. Activate the workflow to run on a schedule"
      }
    },
    {
      "id": "5fead80a-de3a-4f45-a524-5228def7b4ad",
      "name": "Cool down Discord API rate limits",
      "type": "n8n-nodes-base.wait",
      "position": [
        280,
        400
      ]
    },
    {
      "id": "5a8d6402-458c-4c24-b379-6a41908a5af3",
      "name": "Get all Discord channels",
      "type": "n8n-nodes-base.discord",
      "position": [
        40,
        400
      ]
    },
    {
      "id": "a2b1d905-849d-4392-95db-e545f542ba78",
      "name": "Cool down Message deletion API rate limits",
      "type": "n8n-nodes-base.wait",
      "position": [
        1680,
        340
      ]
    },
    {
      "id": "8c134cfe-dcb1-400d-a518-17ed3f1cbf62",
      "name": "Cool down Get messages API rate limits",
      "type": "n8n-nodes-base.wait",
      "position": [
        1000,
        480
      ]
    },
    {
      "id": "18ba10df-dcec-4d27-8ecf-06171939b7eb",
      "name": "Get messages from Channel",
      "type": "n8n-nodes-base.discord",
      "position": [
        800,
        480
      ]
    },
    {
      "id": "57f2395a-b624-41d3-aada-4107b21a3359",
      "name": "Delete Message",
      "type": "n8n-nodes-base.discord",
      "position": [
        1500,
        340
      ]
    },
    {
      "id": "c224ef25-57d8-4fe6-b14a-b09131ce8c1c",
      "name": "Filter Messages older than 7 days",
      "type": "n8n-nodes-base.filter",
      "position": [
        1000,
        320
      ]
    },
    {
      "id": "c3654c25-6318-4652-9f76-82770cc28324",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        300
      ],
      "parameters": {
        "width": 194,
        "height": 80,
        "content": "**Tip 👇**\nOAuth2 Authentication is very easy to setup"
      }
    },
    {
      "id": "f3d8b35e-6b13-4df9-bd33-2d44381e6fc5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        -60
      ],
      "parameters": {
        "width": 600,
        "height": 280,
        "content": "# Nightly Discord Channel Cleanup\n### This workflow runs every day at 9:00 p.m. and:\n- Retrieves all Discord channels using your provided credentials.\n- Pauses briefly to respect Discord API rate limi"
      }
    }
  ],
  "connections": {
    "Delete Message": {
      "main": [
        [
          {
            "node": "Cool down Message deletion API rate limits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every day at 9pm": {
      "main": [
        [
          {
            "node": "Get all Discord channels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Channels": {
      "main": [
        [
          {
            "node": "Filter Messages older than 7 days",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get messages from Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Messages": {
      "main": [
        [],
        [
          {
            "node": "Delete Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all Discord channels": {
      "main": [
        [
          {
            "node": "Cool down Discord API rate limits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get messages from Channel": {
      "main": [
        [
          {
            "node": "Cool down Get messages API rate limits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cool down Discord API rate limits": {
      "main": [
        [
          {
            "node": "Loop Over Channels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Messages older than 7 days": {
      "main": [
        [
          {
            "node": "Loop Over Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cool down Get messages API rate limits": {
      "main": [
        [
          {
            "node": "Loop Over Channels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cool down Message deletion API rate limits": {
      "main": [
        [
          {
            "node": "Loop Over Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}