n8n workflow template · 10 nodes · OpenAI
IT Ops AI SlackBot Workflow Chat with your knowledge base is a free n8n workflow template that starts when its webhook receives an HTTP request and works with OpenAI and Slack. It has 10 nodes, 4 of them AI nodes (OpenAI Chat Model, Window Buffer Memory, Call n8n Workflow Tool and AI Agent). The notes inside the workflow say: “The first node receives all messages from Slack API via Subscription Events API. You can find more information about setting up the subscription events API by clicking here.” To run it, you add your own credentials for OpenAI API and Slack API.
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
The first node receives all messages from Slack API via Subscription Events API. You can find more information about setting up the subscription events API by clicking here. The second node responds to the periodic security challenges that Slack sends to ensure the N8n webhook is still active.
If the message received is from a Bot instead of a real user, it will ignore the message.
Once N8n sees that the messaged received is from a user, it will respond right away to acknowledge a message was received. You can edit the message by opening the node below.
Because we are passing the channel ID of the user to the memory module, n8n is storing the last 5 slack messages sent to it per slack channel. This means that it will remember all your users conversations separately from one another and not get confused by different requests from different users. You can increase the memory storage by using a different storage medium and increase the number of prompts and responses it should remember.
This workflow currently uses OpenAI to power it's responses, but you can open the AI Agent node below and set your own AI LLM using the n8n options offered.
Once the AI response is generated in response to the slack message, n8n delete's it's original Message Received message to avoid cluttering up the user's DMs, and then sends the final Slack message back to the user.
Building your own tools for an AI Agent to use is simple and straightforward, but requires that you build a second workflow and then connect it to this one by inputting the workflow ID from the workflow URL in the Custom n8n KB Tool sub node.
This gives you the freedom to work with any tool, whether n8n has support for it or not. In this sample build, we have connected the AI agent to Confluence, which does not have a native built in n8n node. For this we use the HTTP request node and pointed it to Confluence's search api. It then returns a response that the AI agent uses to generate a final slack message response to the user.
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
When an employee messages the IT department slack app, the workflow kicks off with the "Receive DMs" node, which captures incoming messages and ensures a secure and active communication line by responding to Slack's webhook challenges.
How It Works
Deploy this workflow to improve response times and enhance the efficiency of your IT support services.
To change the model used, simply delete the ChatGPT model and replace with a different supported model by hitting the plus sign under model in the AI Agent.
The 10 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:
Configure your own credentials after importing. Create each credential in n8n, then select it in the node.
Do you need somewhere to run it? Read our guide to self-hosted n8n.
We can adapt this workflow to your apps, data and process, then deploy and support it.
Contact Us