Skip to content
FlowHubFluxonLab
C
AI Automationfree

Automated Discord Spam Moderation with AI and Human-in-the-Loop

by Jimleukadapted from n8n official workflow galleryUpdated Aug 2026
RequiresCCodeDiscordDiscordOpenAI Chat ModelOpenAI Chat ModelText ClassifierText Classifier
Share Post Share
TCSpam DetectionGet Recent MessagesGet Recent Mess…RDOnly OnceModelWarn UserWarn User OnlyCoGroup By UserSIFor Each User...SOSplit OutCoMessage to ListNotify Moderators with Send & WaitNotify Moderato…SeFlag as SpamSeFlag as Not SpamMeMergeFiSpam Messages OnlySpam Messages O…IfHas Flagged Messages?Has Flagged Mes…CoGet Message IDsDelete MessagesSwReceive InstructionsReceive Instruc…EWModeration SubworkflowModeration Subw…EWWhen Executed by Another WorkflowWhen Executed b…NONo Action TakenScSchedule Trigger1234567891011121314151617
1/5
FLOWS
STEPS · 17
Runs on a schedule

This n8n template demonstrates how you can automate community moderation using human-in-the-loop functionality for Discord. The use-case is for detecting and dealing with spam messages in a predefined and consistent way. Human-in-the-loop allows for a balance between overly aggressive bots and time and effort from the moderation team. How it works A scheduled trigger is used to scan the most recent messages in a Discord Channel. Messages are tagged via the "Remove Duplicates" node so they don't get processed again in the future. Messages are grouped by user to allow for minimising of number of notifications sent. An AI text classifier node is then used to detect for spam in each user's message. When detected, a notification is sent to a moderation channel using the Send-and-wait mode for Discord. This notification comes with an n8n form and dropdown list of predefined actions to take in dealing with the spam messages. Once sent the workflow waits until a response is received. Once a moderator selects an action, the workflow continues and carries out a predefined moderation action.

Tags

n8nreference-onlydiscordlm-chat-open-aitext-classifier
Connects
CCodediscordDiscordopenaichatmodelOpenAI Chat ModeltextclassifierText Classifier
CategoryAI Automation
Triggermanual
Complexityadvanced
Nodes23
AddedMar 29, 2025

Related workflows

See all AI Automation
Agmailopenaichatmodeltextclassifier
free

Suggest meeting slots using AI

The purpose of this n8n workflow is to automate the process of identifying incoming Gmail emails that are requesting an appointment, evaluating their content, checking calendar availability, and then composing and sending a response email. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team
ACDgmail
free

AI: Summarize podcast episode and enhance using Wikipedia

The workflow automates the process of creating a summarized and enriched podcast digest, which is then sent via email. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team
BCWopenaichatmodel
free

Audit landing page CRO and log results with OpenAI and Data Tables

Quick overview This workflow collects a landing page URL, scrapes its HTML, and uses OpenAI to generate a structured conversion-rate-optimization (CRO) audit with scores and prioritized tips, then renders a styled report in the browser and logs each audit to an n8n Data Table. How it works Presents an n8n Form where the user submits a landing page URL. Fetches the landing page HTML via an HTTP request with retries, and routes to an error page if the URL can’t be retrieved. Sends the scraped HTML and URL to OpenAI to produce a CRO audit including an overall score, category scores, a written roast, and a ranked list of optimization tips. Uses a structured output parser with an OpenAI “fixer” model to validate and auto-correct the AI response into the required JSON schema. Builds a styled HTML report from the structured audit results. Logs the audit metadata (URL, score, verdict, summary, language, timestamp) to an n8n Data Table and displays the report back in the user’s browser. Setup Add an OpenAI API credential and select it for both the main OpenAI model and the output-fixer model. Create or select an n8n Data Table (for example, “CRO Audit Log”) and map the columns used for url,

by Dr. Firas