Slack quietly released an update to their API that allows developers to build "AI Apps & Agents", which is a special classification of apps that have access to several special capabilities including:
This workflow demonstrates how to build a Slack agent that takes advantage of all of these features.
For a full video walkthrough of this workflow, watch this YouTube tutorial.
All of the below steps are required for this workflow to function properly unless otherwise noted.
assistant:write
chat:write
channels:read
im:history
message.im
In order to save the chat history and give your agent a working memory, you'll need your own Postgres database. You can use Supabase, Neon, or any other Postgres database provider. Once you've added your database's credentials to n8n, you can select those credentials in the Postgres Chat Memory node. This worklow saves all chat history in a table called chat_histories, but you name the table whatever you want.
You'll need to create the following credentials:
Now that you've created your Slack app, have your Postgres database, and have created credentials, follow these steps to wire up your workflow:
Once you've completed the setup process and added in your credentials, you'll have a fully functional Slack chatbot complete with threads, loading UI, and the ability to pin your app to your workspace's top bar.
Now that this skeleton app is in place, it's up to you to add horsepower to the AI agent at the center of it all. Customize the prompts and add whatever tools you'd like. The sky is the limit!
If you have any questions or feedback about this workflow, or would like me to build custom workflows for your business, email me at [email protected].