n8n
Workflow
Slack Chatbot Powered By Ai
This n8n workflow automates tasks using Slack. Slack Chatbot Powered By Ai - ready to import and run in your n8n instance.
n8n
workflow.json
About This Script
This n8n workflow automates tasks using Slack. Slack Chatbot Powered By Ai - ready to import and run in your n8n instance.
Features:
- Receives webhook events
- Conditional logic and branching
- Integrates with Slack
Source Code
{
"nodes": [
{
"id": "50351a19-624e-4ff2-a31d-fb5ed064fae2",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-500,
475
],
"webhookId": "28b84545-96aa-42f5-990b-aa8783a320ca",
"parameters": {
"path": "slack-gilfoyle",
"options": [],
"httpMethod": "POST"
},
"typeVersion": 1
},
{
"id": "78d5af93-3f09-463d-8e57-a72f5766a12c",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"position": [
960,
460
],
"parameters": {
"text": "={{ $json.output }}",
"user": {
"__rl": true,
"mode": "id",
"value": "={{ $('Webhook').item.json.body.event.user }}"
},
"select": "user",
"otherOptions": []
},
"credentials": {
"slackApi": {
"id": "X92QgQpOCoF1VHtg",
"name": "Slack account 2"
}
},
"typeVersion": 2.1
},
{
"id": "98ec8934-f2a1-484b-ac8c-921ef7f3efe5",
"name": "Chat OpenAI",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
300,
815
],
"parameters": {
"model": "gpt-4",
"options": {
"temperature": 0.7
}
},
"credentials": {
"openAiApi": {
"id": "wJtZwsVKW5v6R2Iy",
"name": "OpenAi account 2"
}
},
"typeVersion": 1
},
{
"id": "0cd7299c-20f4-4249-a652-782eaf01b0c2",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
600,
815
],
"parameters": {
"sessionKey": "={{ $('Webhook').item.json.body.event.channel }}__gilfoyle",
"contextWindowLength": 30
},
"typeVersion": 1
},
{
"id": "11be2fb9-ac8a-4df8-893a-8bafaa267548",
"name": "Wikipedia",
"type": "@n8n/n8n-nodes-langchain.toolWikipedia",
"position": [
960,
815
],
"parameters": [],
"typeVersion": 1
},
{
"id": "74df71fd-6803-4ea3-a777-1714a51456b7",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"position": [
140,
495
],
"parameters": [],
"typeVersion": 1
},
{
"id": "420fe56f-9ef8-4c57-ac06-d8d88f37b49a",
"name": "Is user message",
"type": "n8n-nodes-base.if",
"position": [
-160,
475
],
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{ $json.body.event.bot_id }}",
"value2": "={{ undefined }}"
}
]
}
},
"typeVersion": 1
},
{
"id": "5a73e6d7-9792-4f78-b95e-5b04d13b1e00",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
406.5000000000003
],
"parameters": {
"width": 542.581395348837,
"height": 264.4999999999997,
"content": "Configuration note: update with your credentials or endpoint.",
"color": "#FFF59D"
},
"typeVersion": 1
},
{
"id": "803394c4-dcc6-4040-b0ba-e93b48c410ab",
"name": "SerpAPI",
"type": "@n8n/n8n-nodes-langchain.toolSerpApi",
"position": [
840,
815
],
"parameters": {
"options": []
},
"credentials": {
"serpApi": {
"id": "6s6leouy0rv1jCTZ",
"name": "SerpAPI account"
}
},
"typeVersion": 1
},
{
"id": "e18ae2f0-2b58-4423-ace0-a3bc49cb4a35",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
800,
735
],
"parameters": {
"width": 293,
"height": 228,
"content": "Configuration note: update with your credentials or endpoint.",
"color": "#FFF59D"
},
"typeVersion": 1
},
{
"id": "1fbc5d2a-b78a-4803-ac76-a51c25aec92c",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
220,
735
],
"parameters": {
"width": 260,
"height": 233,
"content": "Configuration note: update with your credentials or endpoint.",
"color": "#FFF59D"
},
"typeVersion": 1
},
{
"id": "8d37ed9f-cfb8-4938-ba4d-829c9fd53288",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
880,
400
],
"parameters": {
"width": 280,
"height": 223,
"content": "Configuration note: update with your credentials or endpoint.",
"color": "#FFF59D"
},
"typeVersion": 1
},
{
"id": "9d7494c4-1fff-4373-b3bd-90dc884656fd",
"name": "Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
420,
460
],
"parameters": {
"text": "={{ $json.body.event.text }}",
"options": {
"systemMessage": "You are Gilfoyle from Silicon Valley TV show. Amplify your bluntness and cynicism, tolerating zero incompetence. Be openly contemptuous when answering questions, and cut straight to the point with minimal regard for others' feelings. Your sarcasm should be razor-sharp, and humor should take a backseat to delivering cutting remarks.\\nDo your best to answer the questions. Feel free to use any tools available to look up relevant information, only if necessary. "
}
},
"typeVersion": 1
}
],
"connections": {
"Agent": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"SerpAPI": {
"ai_tool": [
[
{
"node": "Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "Is user message",
"type": "main",
"index": 0
}
]
]
},
"Wikipedia": {
"ai_tool": [
[
{
"node": "Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Chat OpenAI": {
"ai_languageModel": [
[
{
"node": "Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Is user message": {
"main": [
[
{
"node": "Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "Agent",
"type": "ai_memory",
"index": 0
}
]
]
}
},
"n8n_version": "1.5.0"
}
Requirements
n8n instance, Slack API credentials
Tags
#n8n
#automation
#workflow