AutomationFlowsAI & RAG › Slack AI Streaming Agent - Template

Slack AI Streaming Agent - Template

Slack AI Streaming Agent - Template. Uses memoryBufferWindow, CUSTOM, lmChatOpenAi, httpRequest. Webhook trigger; 8 nodes.

Webhook trigger★★★☆☆ complexityAI-powered8 nodesMemory Buffer WindowCustomOpenAI ChatHTTP Request
AI & RAG Trigger: Webhook Nodes: 8 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow follows the HTTP Request → OpenAI Chat recipe pattern — see all workflows that pair these two integrations.

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 →

Download .json
{
  "name": "Slack AI Streaming Agent - Template",
  "nodes": [
    {
      "parameters": {
        "contextWindowLength": 20
      },
      "id": "95d40761-c1c6-4e60-b673-f43301ac6db7",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        672,
        1696
      ],
      "notesInFlow": true,
      "notes": "In-memory only. Conversation history is lost on n8n restart.\nFor persistence, replace with Postgres Chat Memory or Redis Chat Memory."
    },
    {
      "parameters": {
        "channelId": "={{ $json.channel }}",
        "threadTs": "={{ $json.thread_ts }}",
        "recipientUserId": "={{ $json.user_id }}",
        "recipientTeamId": "={{ $json.team_id }}",
        "systemPrompt": "You are a helpful AI assistant. Answer questions clearly and concisely.",
        "options": {}
      },
      "type": "CUSTOM.slackAiStreamingAgent",
      "typeVersion": 1,
      "position": [
        528,
        1488
      ],
      "id": "8a4323e7-31ec-4905-a0b5-d01d9664cd16",
      "name": "Slack AI Streaming Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        528,
        1696
      ],
      "id": "97d42db4-f4a1-4be9-b05a-2d5e0175cfbe",
      "name": "OpenAI Chat Model"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "slack-events",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "f71a4e79-2da8-4533-bc88-76efa702b5a2",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -304,
        1424
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ challenge: $json.body?.challenge ?? '' }) }}",
        "options": {
          "responseCode": 200
        }
      },
      "id": "905a6489-f865-47d0-959e-9165336f9923",
      "name": "Respond 200",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        -112,
        1424
      ],
      "notesInFlow": true,
      "notes": "Immediately returns 200 to Slack (3-second timeout).\nWorkflow continues executing after this node."
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://slack.com/api/assistant.threads.setSuggestedPrompts",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "slackApi",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json; charset=utf-8"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({\n  channel_id: $('Webhook').item.json.body.event.assistant_thread.channel_id,\n  thread_ts: $('Webhook').item.json.body.event.assistant_thread.thread_ts,\n  prompts: [\n    { title: \"Summarize\", message: \"Summarize the key points of this conversation.\" },\n    { title: \"Help me write\", message: \"Help me draft a message about...\" },\n    { title: \"What can you do?\", message: \"What kinds of tasks can you help me with?\" }\n  ]\n}) }}",
        "options": {}
      },
      "id": "e1287aca-0201-4feb-8c51-f1f11feb9b28",
      "name": "Set Suggested Prompts",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        336,
        1280
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a1b2c3d4-aaaa-4000-8000-00000000000a",
              "name": "channel",
              "value": "={{ $('Webhook').item.json.body.event.channel }}",
              "type": "string"
            },
            {
              "id": "a1b2c3d4-bbbb-4000-8000-00000000000b",
              "name": "thread_ts",
              "value": "={{ $('Webhook').item.json.body.event.thread_ts ?? $('Webhook').item.json.body.event.ts }}",
              "type": "string"
            },
            {
              "id": "a1b2c3d4-cccc-4000-8000-00000000000c",
              "name": "user_id",
              "value": "={{ $('Webhook').item.json.body.event.user }}",
              "type": "string"
            },
            {
              "id": "a1b2c3d4-dddd-4000-8000-00000000000d",
              "name": "team_id",
              "value": "={{ $('Webhook').item.json.body.team_id }}",
              "type": "string"
            },
            {
              "id": "a1b2c3d4-eeee-4000-8000-00000000000e",
              "name": "chatInput",
              "value": "={{ ($('Webhook').item.json.body.event.text ?? '').replace(/<@[A-Z0-9]+>/g, '').trim() }}",
              "type": "string"
            },
            {
              "id": "49d21ddb-ce24-491c-88de-2c195d25fecb",
              "name": "sessionId",
              "value": "={{ $('Webhook').item.json.body.event.channel }}_{{ $('Webhook').item.json.body.event.thread_ts ?? $('Webhook').item.json.body.event.ts }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "ee1ec408-bc24-4578-92ed-d7639699a6d7",
      "name": "Extract Event Data",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        336,
        1488
      ]
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Webhook').item.json.body.type }}",
                    "rightValue": "url_verification",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "8f9a33fb-afa1-41d4-b21c-0fb929d15253"
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Webhook').item.json.body.event?.type }}",
                    "rightValue": "assistant_thread_started",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "d53c692a-9398-4002-81ea-705e2a7b8317"
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Webhook').item.json.body.event?.type }}",
                    "rightValue": "app_mention",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "91136a0f-be04-49a3-905c-a8e66291f4c8"
                  },
                  {
                    "leftValue": "={{ $('Webhook').item.json.body.event?.subtype }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "empty"
                    },
                    "id": "928bc62e-9a52-4cdc-8a62-0d2ce44e94d1"
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Webhook').item.json.body.event?.type }}",
                    "rightValue": "message",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "0b113971-e629-4cd3-8f1c-ad500b1e48a0"
                  },
                  {
                    "leftValue": "={{ $('Webhook').item.json.body.event?.subtype }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "empty"
                    },
                    "id": "6674d713-560c-4466-98ea-09b6f519193e"
                  },
                  {
                    "leftValue": "={{ $('Webhook').item.json.body.event?.bot_id }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "empty"
                    },
                    "id": "65fce555-f4f0-4c88-8647-6e12c1ddd496"
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {
          "fallbackOutput": "none"
        }
      },
      "id": "d153259e-58c0-40db-9e31-06c6d5cab660",
      "name": "Route by Event",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3,
      "position": [
        96,
        1392
      ]
    }
  ],
  "connections": {
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "Slack AI Streaming Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Slack AI Streaming Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Respond 200",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond 200": {
      "main": [
        [
          {
            "node": "Route by Event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Event Data": {
      "main": [
        [
          {
            "node": "Slack AI Streaming Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Event": {
      "main": [
        [],
        [
          {
            "node": "Set Suggested Prompts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Event Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Event Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Slack AI Streaming Agent - Template. Uses memoryBufferWindow, CUSTOM, lmChatOpenAi, httpRequest. Webhook trigger; 8 nodes.

Source: https://github.com/sskmy1024y/n8n-nodes-slack-ai-streaming-agent/blob/main/examples/slack-ai-agent-workflow.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Businesses and developers who want to automate customer support or engagement on Facebook Messenger using AI-powered responses.

HTTP Request, Memory Buffer Window, OpenAI Chat +1
AI & RAG

Automate your HR onboarding process by transforming complex policy PDFs into friendly, structured onboarding videos using AI and HeyGen. 📄🎬 This workflow receives HR policy documents via webhook, extr

HTTP Request, Google Drive, Agent +3
AI & RAG

This workflow automates the entire process of taking a raw user-submitted script, rewriting it into a polished HeyGen-ready narration, generating a full avatar video, handling all processing checks, r

HTTP Request, Agent, Memory Buffer Window +6
AI & RAG

12-Automate_WhatsApp_Booking_System_with_GPT_4_Assistant__Cal_com_and_SMS_Reminders. Uses agent, lmChatOpenAi, memoryBufferWindow, googleSheetsTool. Webhook trigger; 26 nodes.

Agent, OpenAI Chat, Memory Buffer Window +5
AI & RAG

12-Automate_WhatsApp_Booking_System_with_GPT_4_Assistant__Cal_com_and_SMS_Reminders. Uses agent, lmChatOpenAi, memoryBufferWindow, googleSheetsTool. Webhook trigger; 26 nodes.

Agent, OpenAI Chat, Memory Buffer Window +5