Access control for AI agents (RBAC) using Airtable and Telegram
Needs changesWhat this workflow does
This AI workflow has 23 nodes and runs on Telegram events (message) (plus 1 other trigger). Along the way it connects OpenAI Chat Model, Telegram, Airtable and Wikipedia and 1 more. It also calls geocoding-api.open-meteo.com and api.open-meteo.com over HTTP.
How it runs
Trigger: On Telegram events (message) (plus 1 other trigger).
- Get user permissions (Airtable): search
- Settings (Edit Fields (Set)): sets 3 fields: chatInput, sessionId, allowed_tools
- Unknown user (If): checks a condition and branches into true / false
- Weather Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 1 tool (Check permissions); memory: Simple Memory
- Reply: unknown user (Telegram): uses Telegram
- Set input (Edit Fields (Set)): sets 3 fields: name, granted_roles, allowed_tools
- Main Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 2 tools (Wikipedia, Check permissions); memory: Simple Memory
- Reply with results (Telegram): uses Telegram
Services it uses
HTTP calls to: geocoding-api.open-meteo.com, api.open-meteo.com
Before you upgrade to n8n 3.0
3 things in this workflow are removed in n8n 3.0. Fix them before you upgrade:
- LangChain Code (legacy) in Check permissions, Check permissions1: no direct replacement.
- HTTP Request Tool (legacy) in get_coordinates, get_weather: replace with HTTP Request node connected to the AI Agent's Tool input.
- AI Agent v1 (old agent modes) in Weather Agent (v1.8), Main Agent (v1.8): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| 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
From the author
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…