Skip to main content

Access control for AI agents (RBAC) using Airtable and Telegram

Workflow preview

Workflow preview
100%
Access control for AI agents (RBAC) using Airtable and Telegram preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Purpose This workflow allows granular control over the access to tools connected to AI Agents (including Multi Agent setups) using R ole B ased A ccess C ontrol. Demo & Explanation [![demo video](h...

Best for

  • Engineering automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.code, n8n-nodes-base.telegramtrigger, n8n-nodes-base.set, n8n-nodes-base.airtable, n8n-nodes-base.executeworkflowtrigger, @n8n/n8n-nodes-langchain.toolcode

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Access control for AI agents (RBAC) using Airtable and Telegram
Workflow name
Access control for AI agents (RBAC) using Airtable and Telegram

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

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.

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 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 2 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 3 - Check permissions

Type / Role
@n8n/n8n-nodes-langchain.code - code
Config choices
Version 1

Block 4 - Telegram Trigger

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

Block 5 - Set input

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

Block 6 - Get user permissions

Type / Role
n8n-nodes-base.airtable - airtable
Config choices
Version 2.1

Block 7 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 8 - Settings

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

Block 9 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 10 - Simple Memory1

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 11 - Check permissions1

Type / Role
@n8n/n8n-nodes-langchain.code - code
Config choices
Version 1

Block 12 - list_granted_roles

Type / Role
@n8n/n8n-nodes-langchain.toolCode - toolCode
Config choices
Version 1.1

Block 13 - list_allowed_tools

Type / Role
@n8n/n8n-nodes-langchain.toolCode - toolCode
Config choices
Version 1.1

Block 14 - calculator

Type / Role
@n8n/n8n-nodes-langchain.toolCalculator - toolCalculator
Config choices
Version 1

Block 15 - Wikipedia

Type / Role
@n8n/n8n-nodes-langchain.toolWikipedia - toolWikipedia
Config choices
Version 1

Block 16 - get_coordinates

Type / Role
@n8n/n8n-nodes-langchain.toolHttpRequest - toolHttpRequest
Config choices
Version 1.1

Block 17 - get_weather

Type / Role
@n8n/n8n-nodes-langchain.toolHttpRequest - toolHttpRequest
Config choices
Version 1.1

Block 18 - weather_agent

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2.1

Block 19 - Weather Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 20 - Unknown user

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

Block 21 - Sticky Note

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

Block 22 - Sticky Note1

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

Block 23 - Sticky Note2

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

Block 24 - Sticky Note3

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

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

3. Summary Table

Workflow Access control for AI agents (RBAC) using Airtable and Telegram
Complexity advanced
Nodes 36
Categories Engineering, AI Chatbot
Author Mario
Published 11 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3988/3988.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 Access control for AI agents (RBAC) using Airtable and Telegram do?

Purpose This workflow allows granular control over the access to tools connected to AI Agents (including Multi Agent setups) using R ole B ased A ccess C ontrol. Demo & Explanation [![demo video](h...

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 Engineering, AI Chatbot use case.