Control AI agent tool access with Port RBAC and Slack mentions
Needs changesWhat this workflow does
This AI workflow has 17 nodes and runs on Slack events. Along the way it connects OpenAI Chat Model, Slack, Wikipedia and PagerDuty and 1 more. It also calls api.port.io over HTTP.
How it runs
Trigger: On Slack events.
- Get user's slack profile (Slack): get profile (user)
- Get Port access token (HTTP Request): calls api.port.io (POST)
- Get Regions from Port (HTTP Request): calls api.port.io
- Get user permission from Port (HTTP Request): calls an HTTP API
- Unknown user (If): checks a condition and branches into true / false
- Send a message (Slack): uses Slack
- Set input (Edit Fields (Set)): sets 4 fields: name, granted_roles, allowed_tools…
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (Check permissions); memory: Chat Memory
- Send output message (Slack): uses Slack
Services it uses
HTTP calls to: api.port.io
Before you upgrade to n8n 3.0
2 things in this workflow are removed in n8n 3.0. Fix them before you upgrade:
- LangChain Code (legacy) in Check permissions: no direct replacement.
- AI Agent v1 (old agent modes) in AI 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.
- Also check Slack Trigger requires a signing secret on the Slack API credential.
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 | No direct replacement |
| AI Agent v1 (old agent modes) AI Agent (v1.8) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Rarely used nodes in this template: n8n-nodes-base.pagerDutyTool, n8n-nodes-base.awsS3Tool
Nodes used (13)
- OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - LangChain Code
@n8n/n8n-nodes-langchain.code - Edit Fields (Set)
n8n-nodes-base.set - Calculator
@n8n/n8n-nodes-langchain.toolCalculator - If
n8n-nodes-base.if - Slack Trigger
n8n-nodes-base.slackTrigger - Slack
n8n-nodes-base.slack - HTTP Request
n8n-nodes-base.httpRequest - Wikipedia
@n8n/n8n-nodes-langchain.toolWikipedia - Pager Duty Tool
n8n-nodes-base.pagerDutyTool - Aws S3Tool
n8n-nodes-base.awsS3Tool - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - AI Agent
@n8n/n8n-nodes-langchain.agent
From the author
RBAC for AI agents with n8n and Port This workflow implements role-based access control for AI agent tools using Port as the single source of truth for permissions. Different users get access to different tools based on their roles, without needing a separate…