{
  "name": "Moderate your Discord server using chatGPT-5 & Google Sheets (Learning system)",
  "nodes": [
    {
      "id": "44a9a680-a894-4d11-9560-805023a4316c",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        240,
        240
      ]
    },
    {
      "id": "aec37f9f-3869-49b3-9d41-5b8b429c1f84",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1328,
        176
      ]
    },
    {
      "id": "85e658f9-cd00-4d64-be35-a2ea56f986d9",
      "name": "update admin channel about moderation",
      "type": "n8n-nodes-base.discord",
      "position": [
        2368,
        256
      ]
    },
    {
      "id": "d7aba29d-90a4-4dbd-a3ce-51e58395ec5a",
      "name": "delete bad content",
      "type": "n8n-nodes-base.discord",
      "position": [
        2064,
        256
      ]
    },
    {
      "id": "6793f1ac-84df-4ac5-a8db-be75592ebedd",
      "name": "GPT5 mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1280,
        320
      ]
    },
    {
      "id": "4d84bf71-7fd9-4848-8304-0e8f34495f3b",
      "name": "Get only the bad messages",
      "type": "n8n-nodes-base.code",
      "position": [
        1664,
        240
      ]
    },
    {
      "id": "d7990994-24d8-4ac1-b707-f47779be5737",
      "name": "Get sheet knowledgebase",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        640,
        240
      ]
    },
    {
      "id": "71656c51-2ec8-4452-8ef4-58721e975678",
      "name": "Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -624
      ],
      "parameters": {
        "width": 432,
        "height": 820,
        "content": "# AI-Driven Discord Moderation with Google Sheets Learning & Admin Insights\n\n## How it works:\n\nThis workflow monitors your Discord channel every 3 minutes and uses AI to detect rule-breaking messages."
      }
    },
    {
      "id": "da0b2d16-e6ad-4123-8557-1adc2fb4b44b",
      "name": "Training Data Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        16
      ],
      "parameters": {
        "width": 224,
        "height": 448,
        "content": "## Training Data\nLoads examples from Google Sheets (message_content, should_delete, reason) to teach the AI your moderation standards."
      }
    },
    {
      "id": "e1753b53-7c88-4a60-870b-1b5d732b8f07",
      "name": "Analysis Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        16
      ],
      "parameters": {
        "width": 736,
        "height": 448,
        "content": "## Message Analysis\nFetches recent messages, formats them with training data, and sends to GPT-5 for context-aware moderation."
      }
    },
    {
      "id": "b8ddcc67-1c42-4091-a512-b56f2d07d64c",
      "name": "Processing Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        16
      ],
      "parameters": {
        "width": 944,
        "height": 448,
        "content": "## Processing & Cleanup\nParses AI results, deduplicates, then loops through each flagged message to delete and notifies admin channel."
      }
    },
    {
      "id": "51453ec4-1a0d-48f2-ad65-bbe24bfa63ea",
      "name": "Get recent messages",
      "type": "n8n-nodes-base.discord",
      "position": [
        896,
        240
      ]
    },
    {
      "id": "16857487-962f-44bf-b0cf-abf5d4864a14",
      "name": "prep messages for AI",
      "type": "n8n-nodes-base.code",
      "position": [
        1104,
        240
      ]
    },
    {
      "id": "aa9274ce-2432-4868-a03b-579aacee5bd2",
      "name": "wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        2224,
        256
      ]
    },
    {
      "id": "53de222e-5f41-4bd2-9ed8-9c3155637f74",
      "name": "Set Credentials Here",
      "type": "n8n-nodes-base.set",
      "position": [
        416,
        240
      ]
    },
    {
      "id": "b9a33dd8-a931-44f3-828e-7c9c58d5dcc5",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1840,
        240
      ]
    }
  ],
  "connections": {
    "wait": {
      "main": [
        [
          {
            "node": "update admin channel about moderation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Get only the bad messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT5 mini": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "delete bad content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set Credentials Here",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "delete bad content": {
      "main": [
        [
          {
            "node": "wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get recent messages": {
      "main": [
        [
          {
            "node": "prep messages for AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Credentials Here": {
      "main": [
        [
          {
            "node": "Get sheet knowledgebase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "prep messages for AI": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get sheet knowledgebase": {
      "main": [
        [
          {
            "node": "Get recent messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get only the bad messages": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "update admin channel about moderation": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}