Skip to main content

Moderate your Discord server using chatGPT-5 & Google Sheets (Learning system)

Workflow preview

Workflow preview
100%
Moderate your Discord server using chatGPT-5 & Google Sheets (Learning system) preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Discord AI Content Moderator with Learning System This n8n template demonstrates how to automatically moderate Discord messages using AI powered content analysis that learns from your community sta...

Best for

  • Miscellaneous automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.discord, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.code, n8n-nodes-base.googlesheets, n8n-nodes-base.stickynote, n8n-nodes-base.wait

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Cj Elijah Garay.

Original n8n.io source

1.1 Workflow description

Title
Moderate your Discord server using chatGPT-5 & Google Sheets (Learning system)
Workflow name
Moderate your Discord server using chatGPT-5 & Google Sheets (Learning system)

Discord AI Content Moderator with Learning System

This n8n template demonstrates how to automatically moderate Discord messages using AI-powered content analysis that learns from your community standards. It continuously monitors your server, intelligently flags problematic content while allowing context-appropriate language, and provides a complete audit trail for all moderation actions.

Use cases are many:

Try moderating a forex trading community where enthusiasm runs high, protecting a gaming server from toxic behavior while keeping banter alive, or maintaining professional standards in a business Discord without being overly strict!

Good to know

  • This workflow uses OpenAI's GPT-5 Mini model which incurs API costs per message analyzed (approximately $0.001-0.003 per moderation check depending on message volume)
  • The workflow runs every minute by default - adjust the Schedule Trigger interval based on your server activity and budget
  • Discord API rate limits apply - the batch processor includes 1.5-second delays between deletions to prevent rate limiting
  • You'll need a Google Sheet to store training examples - a template link is provided in the workflow notes
  • The AI analyzes context and intent, not just keywords - "I *cking love this community" won't be deleted, but "you guys are sht" will be
  • Deleted messages cannot be recovered from Discord - the admin notification channel preserves the content for review

How it works

  • The Schedule Trigger activates every minute to check for new messages requiring moderation
  • We'll fetch training data from Google Sheets containing labeled examples of messages to delete (with reasons) and messages to keep
  • The workflow retrieves the last 10 messages from your specified Discord channel using the Discord API
  • A preparation node formats both the training examples and recent messages into a structured prompt with unique indices for each message
  • The AI Agent (powered by GPT-5 Mini) analyzes each message against your community standards, considering intent and context rather than just keywords
  • The AI returns a JSON array of message indices that violate guidelines (e.g., [0, 2, 5])
  • A parsing node extracts these indices, validates them, removes duplicates, and maps them to actual Discord message objects
  • The batch processor loops through each flagged message one at a time to prevent API rate limiting and ensure proper error handling
  • Each message is deleted from Discord using the exact message ID
  • A 1.5-second wait prevents hitting Discord's rate limits between operations
  • Finally, an admin notification is posted to your designated admin channel with the deleted message's author, ID, and original content for audit purposes

How to use

  • Replace the Discord Server ID, Moderated Channel ID, and Admin Channel ID in the "Edit Fields" node with your server's specific IDs
  • Create a copy of the provided Google Sheets template with columns: message_content, should_delete (YES/NO), and reason
  • Connect your Discord OAuth2 credentials (requires bot permissions for reading messages, deleting messages, and posting to channels)
  • Add your OpenAI API key to access GPT-5 Mini
  • Customize the AI Agent's system message to reflect your specific community standards and tone
  • Adjust the message fetch limit (default: 10) based on your server activity - higher limits cost more per run but catch more violations
  • Consider changing the Schedule Trigger from every minute to every 3-5 minutes if you have a smaller community

Requirements

  • Discord OAuth2 credentials for bot authentication with message read, delete, and send permissions
  • Google Sheets API connection for accessing the training data knowledge base
  • OpenAI API key for GPT-5 Mini model access
  • A Google Sheet formatted with message examples, deletion labels, and reasoning
  • Discord Server ID, Channel IDs (moderated + admin) which you can get by enabling Developer Mode in Discord

Customising this workflow

  • Try building an emoji-based feedback system where admins can react to notifications with ✅ (correct deletion) or ❌ (wrong deletion) to automatically update your training data
  • Add a severity scoring system that issues warnings for minor violations before deleting messages
  • Implement a user strike system that tracks repeat offenders and automatically applies temporary mutes or bans
  • Expand the AI prompt to categorize violations (spam, harassment, profanity, etc.) and route different types to different admin channels
  • Create a weekly digest that summarizes moderation statistics and trending violation types
  • Add support for monitoring multiple channels by duplicating the Discord message fetch nodes with different channel IDs
  • Integrate with a database instead of Google Sheets for faster lookups and more sophisticated training data management

If you have questions

Feel free to contact me here:

[email protected] [email protected]

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 3 - update admin channel about moderation

Type / Role
n8n-nodes-base.discord - discord
Config choices
Version 2

Block 4 - delete bad content

Type / Role
n8n-nodes-base.discord - discord
Config choices
Version 2

Block 5 - GPT5 mini

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 6 - Get only the bad messages

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Get sheet knowledgebase

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 8 - Main Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Training Data Section

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Analysis Section

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Processing Section

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Get recent messages

Type / Role
n8n-nodes-base.discord - discord
Config choices
Version 2

Block 13 - prep messages for AI

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 15 - Set Credentials Here

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 16 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

3. Summary Table

Workflow Moderate your Discord server using chatGPT-5 & Google Sheets (Learning system)
Complexity advanced
Nodes 16
Categories Miscellaneous, AI Summarization
Author Cj Elijah Garay
Published 03 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10483/10483.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Moderate your Discord server using chatGPT-5 & Google Sheets (Learning system) do?

Discord AI Content Moderator with Learning System This n8n template demonstrates how to automatically moderate Discord messages using AI powered content analysis that learns from your community sta...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Miscellaneous, AI Summarization use case.