Automate Telegram Toxicity Monitoring with n8n & Google Perspective

Struggling with managing toxic messages in your Telegram groups? This n8n workflow automatically detects toxic language using Google Perspective, then sends polite warnings. It helps maintain healthy chats by filtering profanity in real time, saving moderators hours of manual work.
telegramTrigger
googlePerspective
if
+2
Workflow Identifier: 2371
NODES in Use: Telegram Trigger, Google Perspective, IF, Telegram, NoOp
Automate toxicity monitoring with n8n and Google Perspective

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow listens to every new or edited message in a Telegram group and checks if the message contains toxic language using Google Perspective API. It looks for identity attacks, threats, and profanity in the text. When a message has strong profanity (score above 0.7), the workflow sends a polite warning reply to the message sender automatically. Non-toxic messages move through without any response.

This stops toxic messages from harming the community and saves moderators from reading all chats manually.


Who should use this workflow

Community managers or admins who run Telegram groups focused on support, discussion, or sensitive topics. It suits those who want to keep chat safe and respectful without spending many hours moderating messages.

Any Telegram group that struggles with toxic comments but wants quicker, automatic handling can benefit.


Tools and services used

  • Telegram Bot API: Receives and replies to chat messages.
  • Google Perspective API: Analyzes message text for toxic content.
  • n8n automation platform: Runs and connects all the steps together.

How this workflow works

Inputs

The workflow input is new or changed messages in a Telegram group where the bot is added.

Processing steps

  • The Telegram Trigger node listens to new and edited messages.
  • The message text is sent to the Google Perspective node, requesting scores for identity attack, threat, and profanity.
  • An If node checks if the profanity score is greater than 0.7 to classify toxicity.
  • If the message is toxic, a Telegram node sends a polite warning reply to the sender, directly under the offending message.
  • If the message is not toxic, a NoOp node does nothing and ends the workflow quietly.

Outputs

The output is either a warning message sent in the group chat under the toxic message or no action if messages are clean.


Beginner step-by-step: How to use this workflow in n8n

Step 1: Import the workflow

  1. Download the workflow file using the Download button on this page.
  2. In the n8n editor, click on “Import from File” and select the downloaded workflow file.

Step 2: Set up credentials and configurations

  1. Insert your Telegram bot API credentials in the Telegram Trigger and Telegram nodes.
  2. Add your Google Perspective API OAuth2 credentials to the Google Perspective node.
  3. Ensure the bot is added to your Telegram group with permission to read and send messages.
  4. Verify chat ID and message ID expressions are correct; usually, no changes needed unless the group setup is custom.

Step 3: Test the workflow

  1. Send a test message with profanity in the Telegram group.
  2. Check that the bot sends a polite warning reply right under the message.
  3. Send clean messages and confirm none trigger warnings.

Step 4: Activate workflow for production

  1. Click the Activate button in n8n to run the workflow live.
  2. Make sure your n8n instance runs continuously to listen to all messages.
  3. Optionally, set up error alerts if available to monitor failures.

For privacy or control, consider using self-host n8n.


Customization ideas

  • Change the profanity threshold in the If node from 0.7 to suit your tolerance (e.g., 0.5 for stricter checks).
  • Add more toxic attributes like sexual explicit or spam detection in the Google Perspective node.
  • Edit the warning text in the Telegram node to match the community tone or add helpful info.
  • Use a Google Sheets or database node to log toxic messages for later review.
  • Notify moderators separately by adding another Telegram node to send alerts to mod groups.

Handling common problems

  • 401 Unauthorized from Google Perspective API: Check and update OAuth2 credentials in the Google Perspective node.
  • No warnings in Telegram group: Confirm bot is added and allowed to send messages. Verify chat ID expression is correct.
  • Workflow not triggering on edited messages: Ensure Telegram Trigger listens to “edited_message” and “edited_channel_post” updates.

Summary of key results

✓ The workflow automatically detects toxic or profane messages in Telegram chats.

✓ It sends polite warnings only to messages that pass a set profanity threshold.

✓ Saves moderators several hours daily by replacing manual message reading.

✓ Keeps Telegram communities safer and more respectful.


Automate toxicity monitoring with n8n and Google Perspective

Visit through Desktop to Interact with the Workflow.

Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

Frequently Asked Questions

The Google Perspective node analyzes Telegram messages for toxic content by scoring identity attack, threat, and profanity attributes.
The workflow uses an If node to check if the profanity score from Google Perspective is higher than 0.7. If it is, a warning message is sent.
In the Telegram Trigger node, enable listening to update types “edited_message” and “edited_channel_post”.
Yes, the Google Perspective node can be configured to include more attributes like sexual explicit content or spam for broader monitoring.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.