Templates / Automated discord spam moderation with AI and human-in-the-loop

Automated discord spam moderation with AI and human-in-the-loop

Ready for 3.0

by Jimleuk ✓ · 2,464 views · created 2025-03-29 · Miscellaneous, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 23 nodes and runs on a schedule (every hour) (plus 1 other trigger). Along the way it connects Discord and OpenAI Chat Model.

How it runs

Trigger: On a schedule (every hour) (plus 1 other trigger).

  1. Get Recent Messages (Discord): get many (message)
  2. Notify Moderators with Send & Wait (Discord): send and wait for a reply (message)
  3. Only Once (Remove Duplicates): removes duplicate items
  4. Receive Instructions (Switch): routes items into 3 branches
  5. Group By User (Code): runs custom JavaScript code
  6. Get Message IDs (Code): runs custom JavaScript code
  7. Warn User Only (Discord): work with message
  8. Split Out: splits a list into separate items
  9. Delete Messages (Discord): delete message
  10. For Each User... (Loop Over Items (Split in Batches)): loops over the items in batches

…plus 9 more steps. See the full node list below.

Services it uses

DiscordOpenAI Chat Model

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (16)

From the author

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…

Excerpt from Jimleuk's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.