πŸ”§ Telegram chat access control with user permission database

⚑ 190 views Β· πŸ”§ Miscellaneous

Description

πŸ” n8n Workflow: Access Control for Internal Chats or Chatbots

This n8n workflow helps you restrict access to your internal chats or chatbots so that only authorized team members can interact with them. It’s perfect for setups using Telegram, Slack, or other corporate messengers, where you need to prevent unauthorized users from triggering internal automations.


πŸ“Œ Section 1: Trigger & Input

⚑ Receive Message (Telegram Trigger)

Purpose: Captures every incoming message from a user interacting with your Telegram bot (or another messenger).

How it works: When a user sends a message, it instantly triggers the workflow and passes their username or ID as input data.

Benefit: Acts as the entry point for verifying whether a user is allowed to proceed.


πŸ“Œ Section 2: Access Table Lookup

πŸ“‹ User Access Table (Data Node / Spreadsheet / DB Query)

Purpose: Stores all your team members and their current access status.

Structure Example:

UsernameAccess Status
user1granted
user2denied
user3granted

Benefit: Centralized access control β€” you can easily update user permissions without editing the workflow.


πŸ“Œ Section 3: Permission Check

🧩 Check Access (IF Node)

Purpose: Compares the incoming user’s name or ID against the access table.

Logic:

If status = granted β†’ Allow message to continue  
If status = denied β†’ Stop workflow execution

Benefit: Ensures only approved users can interact with your automations or receive responses.


πŸ“Œ Section 4: Response Handling

πŸ’¬ Send Reply (Telegram Node)

Purpose: Sends a message back to the user depending on their access level.

Paths:

Benefit: Prevents unauthorized access while maintaining a seamless experience for approved users.


πŸ“Š Workflow Overview Table

SectionNode NamePurpose
1. TriggerReceive MessageCaptures incoming messages
2. Access TableUser Access TableStores usernames + permissions
3. CheckCheck AccessVerifies if user has permission
4. ResponseSend ReplySends or blocks response based on status

🎯 Key Benefits

πŸ”— Nodes Used

Airtable, Google Sheets, Telegram, Telegram Trigger, Notion, Filter

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup