n8n Slack AI Memory: Persistent Memory for Slack Bots
Slack bots in n8n handle each message as an isolated workflow execution with no shared state. retainr adds persistent memory — your Slack bot remembers every user and channel context across all runs. Install the community node in 30 seconds.
Every Slack event triggers a fresh n8n execution with no memory of previous events. If a user asks a follow-up question, the bot has no context from the previous exchange. retainr persists the context between executions — store after each response, retrieve before the next.
Add Slack memory to n8n in 3 steps
1
Install the retainr community node
Settings → Community Nodes → Install → n8n-nodes-retainr. Add your retainr API key as a credential. Set up your Slack app with the Events API and add it to your n8n Slack credential.
2
Search memory before each AI call
Add a retainr Search Memory node after the Slack Trigger. Namespace: slack:{user_id} for per-user memory or slack:channel:{channel_id} for shared channel memory. Query: the incoming message.
3
Store memory after each AI response
Add a retainr Store Memory node after your AI step. Namespace: same as above. Content: the user message and AI response. Your Slack bot now builds persistent context for every user.
n8n Slack memory — frequently asked questions
How do I trigger an n8n workflow from Slack messages?
Create a Slack app in the Slack API dashboard, enable Events API, subscribe to the message.channels event, and set the request URL to your n8n webhook endpoint. In n8n, add a Webhook node as the trigger (or use the Slack Trigger node if available). The Slack app must be installed to your workspace.
Should I scope memory per user or per channel?
For AI assistants responding to individual users, scope by user ID: slack:{user_id}. For channel bots where shared context matters (e.g., a project assistant), scope by channel: slack:channel:{channel_id}. For support bots, per-user memory is almost always the right choice.
How do I handle Slack slash commands with memory?
Slash commands send a separate payload to your Slack app request URL. Use a second Webhook node or route by the payload type field. For a /forget command, call DELETE /v1/memories?namespace=slack:{user_id} via HTTP Request to clear the user memory.
Does this work with Slack Connect channels?
Yes. Slack Connect channels have the same user_id and channel_id structure as regular channels. Namespace memory the same way — the user_id is stable across workspaces in Slack Connect.
Can I share memory between a Slack bot and an email AI workflow for the same user?
Yes. Use the user email as the namespace rather than the Slack user ID: user:{email}. Both your Slack and email workflows write to the same namespace, so the AI has a unified view of every interaction regardless of channel.
Give your Slack bot real memory
1,000 memory operations per month. Free forever. No credit card required.