Automate Telegram group security using this robust n8n workflow. New members face a math CAPTCHA challenge, storing verification state in Google Sheets to block bots. Explore this n8n template.
Download this n8n workflow template and start using it instantly.
Telegram group administrators seeking to combat bot spam.
Users needing a customizable security layer implemented with a powerful n8n node structure.
Automation specialists looking for advanced n8n templates involving stateful logic (using Google Sheets).
Developers who require a reliable n8n trigger to monitor group events.
Bot protection is crucial for maintaining healthy online communities. This specialized n8n workflow provides an elegant and effective solution for securing Telegram groups against automated joiners. By utilizing the Telegram n8n node and leveraging Google Sheets as a temporary database, every new member is immediately challenged with a randomly generated math CAPTCHA. This specific n8n workflow ensures that only human users who successfully submit the correct answer within the chat are allowed to remain. If verification fails, the user is automatically banned via an HTTP request, providing a robust, self-cleaning solution. This entire automation demonstrates the powerful capabilities of defining complex, stateful flows using an n8n node structure, offering far more than basic n8n templates.
The entire process is initiated by the n8n trigger for Telegram events.
๐ฑ Telegram Trigger n8n trigger listens for group updates. The โ๏ธ Bot Configuration n8n node sets necessary variables.๐ Check New Member n8n node determines if the event is a user joining the group (Path A) or a message from a current user (Path B).๐ฒ Generate CAPTCHA Question Code n8n node creates a unique math problem and calculates the answer.โ Send CAPTCHA Question n8n node sends the challenge to the new member.๐๏ธ Delete Join Message n8n node.๐พ Store User Answer Google Sheets n8n node.๐ Find Pending CAPTCHA Google Sheets n8n node retrieves the required answer for the user.โ
Verify Answer n8n node compares the user's message content to the stored answer.๐ Welcome New Member, deletes the user's data from Google Sheets using ๐๏ธ Clean User Data (Success), and performs message cleanup.Create URL for banrequest n8n node prepares the API call, and the ๐ซ Ban User (Failed CAPTCHA) HTTP Request n8n node executes the permanent ban. The associated messages are cleaned up.To deploy this comprehensive n8n workflow, follow these steps:
๐ฑ Telegram Trigger and all subsequent Telegram n8n node operations.๐พ Store User Answer, ๐ Find Pending CAPTCHA, and ๐๏ธ Clean User Data (Success) n8n nodes.โ๏ธ Bot Configuration n8n node with your specific Telegram Group Chat ID and other required variables. ๐ฑ Telegram Trigger (n8n trigger): The entry point of this n8n workflow. It is configured to listen for new events within the monitored Telegram group, including new member joins and chat messages.
โ๏ธ Bot Configuration (Set n8n node): Essential for initializing global variables, such as the target chat ID and the base Telegram API URL needed for manual banning requests, enhancing the flexibility of this n8n template.
๐ฒ Generate CAPTCHA Question (Code n8n node): Executes custom JavaScript to randomly generate two numbers and an arithmetic operation, storing the calculated result for later verification.
๐พ Store User Answer / ๐ Find Pending CAPTCHA (Google Sheets n8n node): These nodes manage the state. The first adds the required answer to the sheet; the second retrieves it when the user replies, forming a crucial part of the verification logic in this n8n workflow.
โ
Verify Answer (If n8n node): The core logic control that compares the input received from the user via the n8n trigger against the correct answer retrieved from Google Sheets. Based on this comparison, the n8n workflow branches.
๐ซ Ban User (Failed CAPTCHA) (HTTP Request n8n node): Since direct banning might not be exposed easily in the standard Telegram n8n node, this uses a raw HTTP call to the Telegram Bot API to ensure immediate removal of failed users.
Use this advanced n8n workflow to harness Gemini 2.0 for precise, prompt-based object detection in images. Learn how to scale normalized coordinates using a custom n8n node.

Use this advanced n8n workflow to analyze new YouTube videos, find relevant discussion threads on Reddit, and generate humanized, relevant promotional comments using AI and Google Sheets for an approval queue.

This powerful n8n workflow automatically finds active promo codes using an AI agent (Gemini 2.5 Pro) and SerpAPI, caches results in a Data Table, and notifies users via Telegram or Gmail.

Automate Proxmox infrastructure tasks using an AI agent driven by n8n. This n8n workflow template translates natural language to Proxmox API calls (POST/GET/DELETE) securely.








































