Skip to main content

Protect Telegram groups with math CAPTCHA verification and Google Sheets

Workflow preview

Workflow preview
100%
Protect Telegram groups with math CAPTCHA verification and Google Sheets preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Why this template rocks Lightning fast setup Deploy in under 5 minutes Zero AI costs Uses simple math instead of expensive LLM calls ️ 99% spam blocking Mathematical CAPTCHAs stop bots inst...

Best for

  • Support Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, n8n-nodes-base.if, n8n-nodes-base.code, n8n-nodes-base.googlesheets, n8n-nodes-base.telegram, n8n-nodes-base.httprequest, n8n-nodes-base.set, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Vadym Nahornyi.

Original n8n.io source

1.1 Workflow description

Title
Protect Telegram groups with math CAPTCHA verification and Google Sheets
Workflow name
Protect Telegram groups with math CAPTCHA verification and Google Sheets

Why this template rocks

🚀 Lightning-fast setup - Deploy in under 5 minutes
💡 Zero AI costs - Uses simple math instead of expensive LLM calls
🛡️ 99% spam blocking - Mathematical CAPTCHAs stop bots instantly
⚡ Ultra-efficient - Runs on minimal resources, scales to thousands of users
🎯 Plug-and-play - Just add your bot token and Google Sheet ID

Who's it for

Smart community managers who want maximum protection with minimum complexity. Perfect for:

  • 🎮 Gaming communities (Discord alternatives)
  • 💼 Professional Telegram groups
  • 📚 Educational channels with 100+ members
  • 🌐 Any public group facing spam bot invasions
  • 💰 Communities wanting to save on AI API costs

What it does

This isn't another complicated AI bot - it's a lean, mean spam-fighting machine that works smarter, not harder.

🧠 Simple brilliance: Instead of expensive AI that can be fooled, we use basic math (1+1=?) that bots consistently fail
🎯 Instant results: New member joins → Gets math question → Answers correctly = Welcome! / Wrong answer = Banned
🧹 Auto-cleanup: All verification messages disappear automatically - your chat stays pristine
📊 Smart tracking: Google Sheets integration tracks everything without bloating your database

The genius is in the simplicity - real humans solve "7+3=?" in 2 seconds, bots struggle or ignore it completely.

How it works (the magic behind the simplicity)

Step 1: 👁️ Bot detects new member instantly
Step 2: 🎲 Generates random math question (like "4 + 7 = ?")
Step 3: ❓ Sends personalized challenge mentioning the user
Step 4: 📝 Stores answer in Google Sheets for verification
Step 5: ✅ User responds → Bot checks answer → Success = Welcome / Fail = Ban
Step 6: 🧹 All verification messages auto-delete for clean chat

Why this crushes AI-based solutions:

  • Speed: Math verification takes milliseconds vs AI API calls
  • 💰 Cost: Zero ongoing fees vs expensive LLM tokens
  • 🎯 Accuracy: 99%+ spam detection vs AI false positives
  • 🛡️ Reliability: Simple logic never breaks vs AI model changes

Requirements (minimal setup, maximum power)

  • 🤖 Telegram Bot Token (free from @BotFather - takes 30 seconds)
  • 📊 Google Sheets API (free tier covers 1000s of verifications)
  • 👑 Group Admin Rights (add bot as admin with ban/delete permissions)
  • 🔧 N8N Instance (self-hosted or cloud - works on any plan)

Total setup time: 5 minutes max ⏱️

How to set up

  1. Configure Bot Credentials:

    • Replace YOUR_TELEGRAM_BOT_TOKEN_HERE in the "⚙️ Bot Configuration" node with your actual bot token from @BotFather
    • Ensure your bot has necessary permissions (delete messages, ban users, read messages)
  2. Set up Google Sheets Integration:

    • Create a new Google Sheet with three columns: id, answer, msg_id
    • Replace YOUR_GOOGLE_SHEET_ID_HERE with your Google Sheet ID
    • Configure Google Sheets credentials in N8N with proper service account access
    • Ensure the sheet is accessible by your service account
  3. Configure Telegram Group:

    • Add your bot to the target Telegram group
    • Promote the bot to administrator with permissions to ban users and delete messages
    • Test bot permissions by manually invoking admin functions
  4. Customize Welcome Message:

    • Edit the welcome message template in the "⚙️ Bot Configuration" node to match your community's tone and style
    • Include any group rules, links, or specific information new members should know
  5. Activate and Test:

    • Enable the workflow in N8N
    • Test the complete flow by joining the group with a test account
    • Verify CAPTCHA delivery, answer verification, and both success/failure paths work correctly

💡 Pro tip: The simple math foundation makes ANY customization easy - no AI complexity to break!

Why you'll love this template

⚡ Instant impact: Deploy once, protect forever
💰 Zero ongoing costs: No AI bills, just pure efficiency
🛡️ Battle-tested: Stops 99% of spam bots in real communities
🔧 Maintenance-free: Set it and forget it reliability
📈 Scales infinitely: From 10 to 10,000 members witho

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 - 📱 Telegram Trigger

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

Block 2 - 🔍 Check New Member

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 3 - 🎲 Generate CAPTCHA Question

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

Block 4 - 💾 Store User Answer

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

Block 5 - ❓ Send CAPTCHA Question

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

Block 6 - 🚫 Ban User (Failed CAPTCHA)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - ✅ Verify Answer

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 8 - 🎉 Welcome New Member

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

Block 9 - 🗑️ Clean User Data (Success)

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

Block 10 - 🗑️ Delete Join Message

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

Block 11 - 🗑️ Delete CAPTCHA Question (Success)

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

Block 12 - 📋 Find Pending CAPTCHA

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

Block 13 - 🗑️ Delete User Message

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

Block 14 - ⚙️ Bot Configuration

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

Block 15 - 📋 Template Description

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

Block 16 - 📝 Step 1 Guide

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

Block 17 - 📝 Step 2 Guide

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

Block 18 - 📝 Step 3 Guide

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

Block 19 - 📝 Step 4 Guide

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

Block 20 - ✅ Success Path Guide

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

Block 21 - 🚫 Failure Path Guide

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

Block 22 - 🧹 Cleanup Guide

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

Block 23 - ⚙️ Config Guide

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

Block 24 - 📊 Sheets Guide

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

Showing the first 24 of 25 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Protect Telegram groups with math CAPTCHA verification and Google Sheets
Complexity advanced
Nodes 25
Categories Support Chatbot
Author Vadym Nahornyi
Published 29 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8016/8016.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 Protect Telegram groups with math CAPTCHA verification and Google Sheets do?

Why this template rocks Lightning fast setup Deploy in under 5 minutes Zero AI costs Uses simple math instead of expensive LLM calls ️ 99% spam blocking Mathematical CAPTCHAs stop bots inst...

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 Support Chatbot use case.