The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"nodes": [
{
"id": "50351a19-624e-4ff2-a31d-fb5ed064fae2",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-500,
475
],
"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": {
"name": "<your credential>"
}
},
"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": {
"name": "<your credential>"
}
},
"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": "### Slack POSTs to Webhook on every message so we need to filter-out bot messages"
},
"typeVersion": 1
},
{
"id": "803394c4-dcc6-4040-b0ba-e93b48c410ab",
"name": "SerpAPI",
"type": "@n8n/n8n-nodes-langchain.toolSerpApi",
"position": [
840,
815
],
"parameters": {
"options": {}
},
"credentials": {
"serpApi": {
"name": "<your credential>"
}
},
"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": "### Tools which Agent can use to accomplish the task\n"
},
"typeVersion": 1
},
{
"id": "318040c2-630d-4dd8-8ed2-7ca758750d93",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
520,
735
],
"parameters": {
"width": 248,
"height": 233,
"content": "### Conversation history is stored in memory using channel id as key"
},
"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": "### The chat LM to process the prompt"
},
"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": "### Send agent's output as Slack message\n"
},
"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
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
openAiApiserpApislackApi
About this workflow
Slack Chatbot Powered By Ai. Uses slack, lmChatOpenAi, memoryBufferWindow, toolWikipedia. Webhook trigger; 14 nodes.
Source: https://github.com/Zie619/n8n-workflows — original creator credit. Request a take-down →