Access control for AI agents (RBAC) using Airtable and Telegram
Needs changesNeeds changes. This template uses 3 thing(s) that n8n 3.0 removes: LangChain Code (legacy), HTTP Request Tool (legacy), AI Agent v1 (old agent modes). 3 breaking item(s) found. Static check, last run 2026-10-19.
What to replace before upgrading
| Removed in 3.0 | Replace with |
|---|---|
| LangChain Code (legacy) Check permissions, Check permissions1 | No direct replacement |
| HTTP Request Tool (legacy) get_coordinates, get_weather | HTTP Request node connected to the AI Agent's Tool input |
| AI Agent v1 (old agent modes) Weather Agent (v1.8), Main Agent (v1.8) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (15)
- Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - LangChain Code
@n8n/n8n-nodes-langchain.code - Telegram Trigger
n8n-nodes-base.telegramTrigger - Edit Fields (Set)
n8n-nodes-base.set - Airtable
n8n-nodes-base.airtable - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Code Tool
@n8n/n8n-nodes-langchain.toolCode - Calculator
@n8n/n8n-nodes-langchain.toolCalculator - Wikipedia
@n8n/n8n-nodes-langchain.toolWikipedia - HTTP Request Tool
@n8n/n8n-nodes-langchain.toolHttpRequest - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - AI Agent
@n8n/n8n-nodes-langchain.agent - If
n8n-nodes-base.if - Telegram
n8n-nodes-base.telegram
What it does
Purpose This workflow allows granular control over the access to tools connected to AI Agents (including Multi-Agent setups) using Role Based Access Control. Demo & Explanation !demo video How it works - User permissions are managed in Airtable where every restricted AI tool is listed by name and connected via roles to users - Requests to the Main Agent can be sent through a Telegram message (can be replaced by Whatsapp, IMAP or similar) - On every request the Telegram username is used to query a list of all allowed tools which are linked in Airtable - A LangChain Code node is used to compare that list against the connected tools - Every tool which is not permitted to be used is being replaced by a tool, which has a status response, telling the Agent to return a message to the user, that he is not authorized to use the tool - Otherwise allowed tools are passed through to the Agent, as if they were connected directly to the Agent - The parameters can also be passed to a sub-agent called as a sub-workflow where permissions can be checked the same way - Every response is sent back to the same Telegram conversation Setup - Clone the workflow and select the belonging credentials. You'll need an OpenAI and Airtable Account as well as a Telegram Bot (refer to the docs for the Telegram credentials). - Copy this Airtable Template into your workspace - Follow the instructions given in the yellow sticky notes - Activate the workflow How to use Try this example: - Create a new line in Airtable under “Users” containing your Telegram username and your full name - Set the roles “basic” and “info” - Consider temporarily disconnecting or resetting the chat memories so they do not remember previous confirmations - Start a new chat, asking about your permitted roles - you should get a list of those - Ask about the current weather in your city - you should be informed, that you do not have permission to access that information - Back in Airtable add the role “weather” to your user - Now ask the Agent the same question again - It should give you a proper answer this time From here on you can add tools and create roles to your likings. Disclaimer Please note, that this workflow can only run on self-hosted n8n instances, since it requires the LangChain Code Node.