Skip to content
TheAgent Ecosystem
Use-Case Playbooks

Automate Content Moderation in n8n With an AI Classifier

A three-way router that publishes safe content, blocks abuse, and sends borderline submissions to a human queue

Muhammad Qasim HammadAI-assisted10 min read2,062 words

AI-drafted, reviewed by Muhammad Qasim Hammad on June 24, 2026. See our AI disclosure.

n8n + Claude: AI content moderation that routes 3 ways
Table of contents
  1. What is AI content moderation in n8n?
  2. How does the Text Classifier moderate content?
  3. How much does AI content moderation cost?
  4. Why must uncertain content always go to a human?
  5. How do you build the moderation workflow in n8n, step by step?
  6. Where does AI moderation go wrong?
  7. What should you set up this weekend?

Every comment, review, and form submission your community generates has to be screened before it goes live. Spam lands in one batch, an abusive rant arrives in the next, and a perfectly fine product review sits somewhere in between. At any real volume, no human can read all of it in time. n8n AI content moderation puts an AI classifier in front of that queue, reads each submission, decides whether it is safe, unsafe, or uncertain, and routes it accordingly.

That routing part is where most off-the-shelf tools fail. They offer an auto-delete button with no gray zone, which means borderline content disappears without a human ever seeing it. The build I am going to walk through avoids that entirely. It routes three ways: publish, block-and-log, or send to a human reviewer.

What is AI content moderation in n8n?#

n8n AI content moderation is a workflow where the Text Classifier node reads each incoming submission, assigns it one of your predefined categories, and sends it down a matching output branch. You define the categories (safe, spam, abusive, unsafe, uncertain). The model decides which one fits. The node creates one output per category, so the routing is built in.

Moderation is a classification task, and a classifier's output is tiny. The model returns one label, not a paragraph of analysis. That makes this one of the cheapest useful things an LLM can do.

I route inbound content with Claude the same way I route email. One prompt, one label, one branch. A single node with named outputs replaces the chain of IF nodes you would have written otherwise.

How does the Text Classifier moderate content?#

The Text Classifier (a root node in n8n's LangChain cluster) takes an Input Prompt expression pointing at your submission text, passes it to a connected Chat Model sub-node, and returns a label matching one of your named categories. Each category has a name and a description. The description is the real instruction to the model.

Each category gets its own output branch. Wire the Safe branch to a publish action, the Unsafe branch to a block-and-log step, and the Uncertain branch to a human queue. No extra logic nodes needed.

Here is the option most people miss: When No Clear Match controls what happens when the model cannot confidently assign a category. The default is Discard Item, which silently drops the submission. For moderation, change this to Output on Extra, 'Other' Branch. That creates a separate output you can wire to a reviewer.

Also leave Allow Multiple Classes To Be True turned off. You want one clean routing decision per item, not multi-label output that complicates downstream wiring.

Four steps to build an n8n AI content moderation workflow with the Text Classifier node and Claude Haiku.Four nodes, one routing decision, three output branches.

The optional System Prompt Template lets you override the system prompt entirely using a {categories} placeholder, and Enable Auto-Fixing re-asks the model when it returns malformed output. Both are useful at scale but not required for an initial build.

If you need the moderation response to include a short reason alongside the label (useful for your audit log), the Basic LLM Chain node with a Structured Output Parser sub-node and Require Specific Output Format enabled can return both. The Text Classifier is simpler to wire; the LLM Chain gives you more output fields.

How much does AI content moderation cost?#

Moderating 1,000 user submissions costs about $0.58 in Claude tokens on Haiku 4.5 (as of mid-2026), and $0 in platform fees on self-hosted n8n. One submission is roughly 500 input tokens (system prompt, category descriptions, submission text) and about 15 output tokens (just the label). That makes moderation one of the cheapest AI tasks you can run.

ModelInput $/1MOutput $/1MCost per 1,000 itemsBest for
Claude Haiku 4.5$1.00$5.00$0.58Default choice; one-label output
Claude Sonnet 4.6$3.00$15.00$1.73Nuanced edge cases
Claude Opus 4.8$5.00$25.00$2.88Not needed here

Arithmetic: 0.5M input tokens x $1.00 + 0.015M output tokens x $5.00 = $0.50 + $0.075 = $0.575 per 1,000 items on Haiku 4.5. Rounded: $0.58. Prices as of mid-2026; verify current rates at platform.claude.com/docs/en/about-claude/pricing.

Self-hosted n8n runs under the fair-code sustainable-use license, which means $0 platform fee. n8n Cloud Starter is EUR 20/month if you prefer a managed host.

Key numbers for n8n AI content moderation: 58 cents per 1,000 items, 15 output tokens, zero self-hosted fee, one branch per category.Cost and output scale for a typical moderation setup. Flowchart routing an n8n submission to publish, block and log, or human review based on the classifier decision.Safe publishes, unsafe is blocked and logged, uncertain always goes to a human.

Why must uncertain content always go to a human?#

Uncertain content must go to a human because classification is high-quality but not infallible, and some calls carry real-world consequences that a one-word label cannot fully capture. A three-way router handles this by design: clearly safe content publishes automatically, clearly unsafe content gets blocked and logged, and anything borderline goes to a reviewer.

The uncertain bucket is a feature of good moderation design, not a failure of the model. A well-designed workflow staffs the gray zone rather than forcing the model to decide everything. For high-stakes submissions (legal threats, self-harm, anything with serious offline consequences), the human queue is mandatory regardless of how confident the label looks.

Block-and-log means both parts. Storing what was blocked and the assigned label lets you review false positives, process appeals, and improve your category descriptions over time. An audit trail is not optional if you are moderating a real community.

Checklist of five moderation categories to define in the n8n Text Classifier node for content moderation.Define each with a precise, mutually exclusive description.

How do you build the moderation workflow in n8n, step by step?#

Building the workflow takes four connected nodes and about 30 minutes. Trigger on a new submission, classify it, and route the three outputs to their handlers. The category descriptions you write are the most important part of the whole build.

Here is the full node sequence:

  1. Add a trigger node. Use a Webhook, Form Trigger, or database-polling node. Map the submission text field so it is available as an expression downstream.

  2. Add the Text Classifier node. Set the Input Prompt field to the expression pointing at your submission text, for example {{ $json.comment_body }}.

  3. Attach a Claude Haiku 4.5 Chat Model sub-node. Click the Chat Model slot, select Anthropic Chat Model, choose claude-haiku-4-5, and connect your Anthropic API credential.

  4. Define your categories. Add each category with a name and a description. Example:

code
Name: Safe to publish
Description: The submission is a genuine, on-topic comment, review, or question.
It contains no spam, no promotional links, no abuse, and no illegal content.

Name: Spam or promo
Description: The submission is a generic message designed to promote a product,
service, or website. It may include links, SEO phrases, or is clearly off-topic.

Name: Abusive or harassment
Description: The submission attacks, threatens, or demeans a specific person or group.
Includes slurs, personal insults directed at individuals, and targeted harassment.

Name: Unsafe or illegal
Description: The submission contains or promotes illegal activity, self-harm,
graphic violence, or content that would violate platform terms of service.

Name: Uncertain
Description: The submission does not clearly fit any of the above categories.
It may be ambiguous, use coded language, or sit on the edge of a policy.
  1. Set "When No Clear Match" to the Other branch. Open the node options and change the setting from Discard Item to Output on Extra, 'Other' Branch.

  2. Wire each output to its handler. Connect Safe to your publish action (write to database, post to CMS, approve via API). Connect Unsafe to a block-and-log step (write the item plus its label to a log table). Connect Other and Uncertain to a human review queue. Test on real sample submissions before going live.

Funnel showing a user submission flowing from trigger through AI classification to publish, block, or human review in n8n.Every submission exits through exactly one of three handlers.

Where does AI moderation go wrong?#

AI moderation fails most often at the category description stage, not the model stage. Vague descriptions like "bad content" give the model no clear signal. Overlapping descriptions cause misrouting. The model is only as precise as the instructions you write.

Four failure modes to watch for:

  • Vague or overlapping category descriptions. If "spam" and "unsafe" both describe "bad content," the model will distribute items inconsistently between them. Write each description to be mutually exclusive.

  • Leaving "When No Clear Match" on Discard Item. The default setting drops anything that does not fit a category. On a live community, real user submissions vanish without a record. Always switch to the Other branch.

  • Auto-blocking on a single label for high-stakes content. For anything with real-world consequences, treat the classifier's output as a first pass, not a final decision. Route those to a human regardless of how confident the label looks.

  • Enabling "Allow Multiple Classes To Be True" without a downstream plan. Multi-label output breaks clean routing for moderation. One item, one branch, one action.

The first time this broke for me was when two category descriptions used nearly identical language. The model split borderline items between them unpredictably. Fifteen minutes rewriting the descriptions fixed it completely.

What should you set up this weekend?#

Start with four categories and one human-review queue. Safe, Spam, Abusive, and Unsafe cover the majority of real-world content. Add the Uncertain category from day one so the Other branch is always staffed. Refine descriptions after the first 50 real submissions run through.

Compare what you get with this build versus a keyword blocklist before you commit to either:

Comparison table of AI classifier versus keyword blocklist for n8n content moderation across four attributes.The classifier reads meaning; the blocklist only reads exact words.

For the full breakdown of how the Text Classifier node works end to end, see the dedicated node guide. The same three-way routing pattern applied to an inbox is in the Claude email triage agent walkthrough. Once safe submissions are publishing automatically, a RAG-powered support bot can handle follow-up replies. If you want a hard cap on token spend as volume grows, the Claude API cost-control workflow pairs directly with this setup.

Deploy the four-category version this weekend on a small slice of real traffic, review the Other branch manually for two weeks, and use what you see to sharpen the descriptions. The category descriptions are the most important configuration work in this entire build. Get those right before you automate anything else.

Frequently asked questions

What is AI content moderation in n8n?
It is a workflow where the Text Classifier node reads each incoming submission, assigns it one category (safe, spam, abusive, unsafe, or uncertain), and routes it down a matching output branch to be published, blocked, or sent to a human reviewer.
How much does AI content moderation cost per 1,000 items?
About $0.58 using Claude Haiku 4.5 as of mid-2026, assuming roughly 500 input tokens and 15 output tokens per item. Self-hosted n8n adds $0 to that figure.
What happens to content the model is unsure about?
It goes to a human reviewer. Set 'When No Clear Match' to Output on Extra, 'Other' Branch in the Text Classifier node, then wire that branch to a review queue. Never let uncertain submissions publish automatically.
Is the Text Classifier better than a keyword blocklist?
Yes, for most platforms. It reads the meaning of the submission, so new phrasing and evasive wording still get caught. A keyword blocklist misses anything not on the list and requires constant manual updates.
Which Claude model should I use for moderation?
Claude Haiku 4.5 ($1.00/$5.00 per million tokens as of mid-2026). The output is a single label, so a more expensive model adds no quality benefit. Prompt-caching the category list further cuts input costs to 0.1x.
Can the AI auto-delete unsafe content on its own?
It can block and log content that the classifier marks as unsafe. However, uncertain or borderline items, and any high-stakes content involving legal threats or self-harm, must always reach a human reviewer before any permanent action is taken.

Sources

Primary references and vendor documentation used while drafting and reviewing this article.

  1. n8n Text Classifier node documentation
  2. n8n Basic LLM Chain node documentation
  3. Claude API pricing (Anthropic)
  4. n8n pricing page
  5. n8n sustainable-use license

Written by

Muhammad Qasim Hammad
Muhammad Qasim Hammad
AI agents & automationFounder · Cart Gaze LLCPMP-certified PM

Muhammad Qasim Hammad is an AI agent and automation expert and the founder of Cart Gaze LLC (cartgaze.com). He builds product for the love of it: when an idea lands, a working prototype is usually running within hours, built with the same AI agents and automations he sells. He puts his own output at roughly 20× what it was before agents, and the Agentic OS behind this site is the working proof, documented in public with the tools he actually ran and what they really cost.

AI & Automation Services

Want a pipeline like this running in your business?

I'm Qasim — I design and ship AI agents and n8n automations for solo operators and small teams. Tell me what's eating your team's week, and I'll scope a fix.

Related reading