Agent Access Control with Telegram & Airtable in n8n Automation

This n8n workflow automates secure access control by integrating Telegram and Airtable to check user permissions before running AI tools. It prevents unauthorized tool usage, saving time and ensuring compliance.
Telegram Trigger
Airtable
Agent
+11
Workflow Identifier: 1757
NODES in Use: Telegram Trigger, Airtable, Set, Agent, Code, Simple Memory, Telegram, OpenAI Chat Model, ToolCode, ToolCalculator, ToolWikipedia, ToolHttpRequest, ToolWorkflow, ExecuteWorkflowTrigger
Automate access control with n8n and Telegram

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

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow controls who can use AI tools through Telegram. It stops people without permission from using certain tools. It checks user rights from Airtable and only allows allowed AI functions. People who are not allowed get clear messages telling them to ask their boss.

The workflow listens to Telegram messages from confirmed users. It looks up their roles and allowed tools in Airtable. Then it changes AI tools used by the session. Tools not allowed are turned off with a “not authorized” reply. User input goes to a smart assistant using only allowed tools. The workflow handles special tasks like weather info with a smaller, restricted agent. This system saves time by managing tool access automatically and stops mistakes.


Tools and Services Used


Workflow Inputs, Processing, and Outputs

Inputs

Processing Steps

  • Telegram Trigger captures incoming messages.
  • Airtable node fetches user permissions by username.
  • If node checks if user data exists.
  • Unauthorized users receive a Telegram message denying access.
  • Set node formats permissions data for use.
  • Code node overrides unauthorized tools with a fixed message.
  • Agent nodes process user input using only allowed AI tools.
  • Memory nodes keep session context based on Telegram user ID.
  • Outputs sent back through Telegram node to user chat.

Outputs


Beginner Step-by-Step: How to Use This Workflow in n8n Production

Step 1: Import the Workflow

  1. Download the workflow file using the Download button on this page.
  2. Inside the n8n editor, choose “Import from File” to load the downloaded workflow.

Step 2: Configure Credentials and Settings

  1. Add your Telegram Bot API Key in the credentials section of the Telegram Trigger and Telegram reply nodes.
  2. Enter OpenAI API Key in relevant Agent nodes.
  3. Update Airtable Base ID, Table name, and API Key in the Airtable node to match your Airtable setup.
  4. Make sure Airtable fields for username, roles, and allowed tools exist and are named correctly.

Step 3: Review Code and Prompt Nodes

  1. Check the Code node named “Check permissions” for correct tool names matching your Airtable list.
  2. Look at text prompts in Agent nodes to customize messages if needed.

Step 4: Test the Workflow

  1. Send test messages in Telegram with authorized and unauthorized usernames.
  2. Confirm that users get allowed tools only and correct access-denied messages.

Step 5: Activate the Workflow for Production

  1. Turn the workflow “Active” in n8n to run on all Telegram messages.
  2. Monitor logs for errors and confirm expected behavior in Telegram responses.
  3. Consider exploring self-host n8n if hosting on your own server.

Common Problems and How This Workflow Handles Them

  • If a Telegram user does not exist in Airtable, the workflow sends a clear “unknown user” reply, stopping further actions.
  • If tool permissions are missing or tool names do not match, the Code node disables those tools and replies with “not authorized”.
  • If Telegram messages do not trigger the workflow, it often means missing API keys or webhook misconfiguration. The setup must be double-checked in all Telegram nodes.

How to Customize the Workflow

  • Change OpenAI models in Agent nodes for better speed or quality.
  • Add new AI tools in Langchain nodes, then update Airtable with users allowed to access them.
  • Modify Airtable permission fields for more detailed control and update the Code node accordingly.
  • Change Telegram reply node messages for richer formats like buttons or images.
  • Increase session memory by adjusting Simple Memory node settings or connect to external storage for long sessions.

Summary – What You Get from This Workflow

✓ Controls AI tool access via Telegram commands automatically.
✓ Stops unauthorized users and tools safely.
✓ Saves hours of manual permission checking.
✓ Keeps conversation memory per user.
✓ Supports customizing tools and adding sub-agents.
✓ Works smoothly inside n8n with Airtable permissions.


Automate access control with n8n and Telegram

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The workflow queries Airtable using the Telegram username to get user roles and allowed tools.
The workflow sends an “unknown user” message in Telegram and blocks access to all AI tools.
A Code node disables unauthorized tools by returning fixed “not authorized” messages instead of running the tool.
Import the workflow file in n8n, configure Telegram, Airtable, and OpenAI API keys, test with sample Telegram messages, then activate the workflow.

Promoted by BULDRR AI

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.