{
  "workflow": {
    "id": 7669,
    "name": "Query Slack channel history with natural language using OpenAI",
    "views": 261,
    "recentViews": 0,
    "totalViews": 261,
    "createdAt": "2025-08-20T22:42:19.462Z",
    "description": "\nChat with a Slack channel using AI. This workflow fetches the channel’s message history and lets you ask natural-language questions (“what were the decisions?”, “who’s blocked?”, “summarize yesterday”). The assistant **only** answers from the channel’s actual messages—no guessing.\n\n---\n\n## ⚙️ Setup Instructions\n\n### 1️⃣ Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys)  \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview)  \n3. Add funds to your billing account  \n4. Copy your API key into the **OpenAI credentials** in n8n\n\n### 2️⃣ Connect Slack API\n1. Create an app → &lt;https://api.slack.com/apps&gt;  \n2. **OAuth & Permissions** → add scopes you need to read channel history (typical:  \n   `channels:history`, `groups:history`, `im:history`, `mpim:history`, plus `channels:read`, `groups:read`, `users:read`. Add `chat:write` if you want the bot to reply in Slack.)  \n3. **Install** the app to your workspace → copy the **Bot User OAuth Token**  \n4. In n8n → **Credentials → New → Slack OAuth2 API** → paste token and save  \n5. In the **Slack History** node, select your Slack credential and the **Channel ID** to read\n\n---\n\n## 🗣️ Example Questions You Can Ask\n- “Give me a 5-bullet summary of the last 24 hours.”  \n- “What action items were assigned, and to whom?”  \n- “List open questions that haven’t been answered yet.”  \n- “Who was mentioned most this week?”  \n- “Summarize decisions from the last sprint planning.”  \n- “Show messages with the word ‘blocker’ from the past 2 days.”  \n- “What files/links were shared today?”\n\n---\n\n## 📬 Contact\nNeed help customizing this or adding auto-replies back into Slack?\n\n- 📧 **robert@ynteractive.com**  \n- 🔗 **[Robert Breen](https://www.linkedin.com/in/robert-breen-29429625/)**  \n- 🌐 **[ynteractive.com](https://ynteractive.com)**\n",
    "workflow": {
      "meta": {
        "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
        "templateCredsSetupCompleted": true
      },
      "nodes": [
        {
          "id": "e2c58c94-6864-431d-a5e3-56ea2757cf10",
          "name": "Slack Channel Chatbot",
          "type": "@n8n/n8n-nodes-langchain.agent",
          "position": [
            192,
            -1328
          ],
          "parameters": {
            "options": {
              "systemMessage": "You are a helpful assistant. For all questions, get the slack channel history from the slack history tool. Do not make anythign up. Use only data in the slack tool to answer questions. "
            }
          },
          "typeVersion": 2.2
        },
        {
          "id": "bbb5baca-6411-4d41-8530-3aff0a228513",
          "name": "Chat with Slack",
          "type": "@n8n/n8n-nodes-langchain.chatTrigger",
          "position": [
            -192,
            -944
          ],
          "webhookId": "d38a0072-420b-4de8-86b6-03a8f9a6e254",
          "parameters": {
            "options": {}
          },
          "typeVersion": 1.3
        },
        {
          "id": "51c83a27-1e6d-4c46-bbaf-d34e5c14f707",
          "name": "Sticky Note53",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -256,
            -1344
          ],
          "parameters": {
            "color": 7,
            "width": 224,
            "height": 560,
            "content": "\n- “Give me a 5-bullet summary of the last 24 hours.”  \n- “What action items were assigned, and to whom?”  \n- “List open questions that haven’t been answered yet.”  \n- “Who was mentioned most this week?”  \n- “Summarize decisions from the last sprint planning.”  \n- “Show messages with the word ‘blocker’ from the past 2 days.”  \n- “What files/links were shared today?”"
          },
          "typeVersion": 1
        },
        {
          "id": "3e18db06-f194-4d48-b861-d4724cd83e22",
          "name": "Sticky Note4",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -816,
            -1568
          ],
          "parameters": {
            "width": 400,
            "height": 1056,
            "content": "## ⚙️ Setup Instructions\n\n### 1️⃣ Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys)  \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview)  \n3. Add funds to your billing account  \n4. Copy your API key into the **OpenAI credentials** in n8n\n\n### 2️⃣ Connect Slack API\n1. Create an app → <https://api.slack.com/apps>  \n2. **OAuth & Permissions** → add scopes you need to read channel history (typical:  \n   `channels:history`, `groups:history`, `im:history`, `mpim:history`, plus `channels:read`, `groups:read`, `users:read`. Add `chat:write` if you want the bot to reply in Slack.)  \n3. **Install** the app to your workspace → copy the **Bot User OAuth Token**  \n4. In n8n → **Credentials → New → Slack OAuth2 API** → paste token and save  \n5. In the **Slack History** node, select your Slack credential and the **Channel ID** to read\n\n---\n\n## 🗣️ Example Questions You Can Ask\n- “Give me a 5-bullet summary of the last 24 hours.”  \n- “What action items were assigned, and to whom?”  \n- “List open questions that haven’t been answered yet.”  \n- “Who was mentioned most this week?”  \n- “Summarize decisions from the last sprint planning.”  \n- “Show messages with the word ‘blocker’ from the past 2 days.”  \n- “What files/links were shared today?”\n\n---\n\n## 📬 Contact\nNeed help customizing this or adding auto-replies back into Slack?\n\n- 📧 **robert@ynteractive.com**  \n- 🔗 **[Robert Breen](https://www.linkedin.com/in/robert-breen-29429625/)**  \n- 🌐 **[ynteractive.com](https://ynteractive.com)**\n"
          },
          "typeVersion": 1
        },
        {
          "id": "113a5a1d-3afb-4bbf-81c6-0e6602121f98",
          "name": "Sticky Note52",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            592,
            -1360
          ],
          "parameters": {
            "color": 3,
            "width": 224,
            "height": 640,
            "content": "### 2️⃣ Connect Slack API\n1. Create an app → <https://api.slack.com/apps>  \n2. **OAuth & Permissions** → add scopes you need to read channel history (typical:  \n   `channels:history`, `groups:history`, `im:history`, `mpim:history`, plus `channels:read`, `groups:read`, `users:read`. Add `chat:write` if you want the bot to reply in Slack.)  \n3. **Install** the app to your workspace → copy the **Bot User OAuth Token**  \n4. In n8n → **Credentials → New → Slack OAuth2 API** → paste token and save  \n5. In the **Slack History** node, select your Slack credential and the **Channel ID** to read\n"
          },
          "typeVersion": 1
        },
        {
          "id": "922d2b75-5e58-4e60-a3a3-84ad97ec63f2",
          "name": "Sticky Note50",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -368,
            -1568
          ],
          "parameters": {
            "color": 7,
            "width": 1248,
            "height": 1056,
            "content": "# 💬 Slack Channel Chatbot (n8n + OpenAI)\n\nChat with a Slack channel using AI. This workflow fetches the channel’s message history and lets you ask natural-language questions (“what were the decisions?”, “who’s blocked?”, “summarize yesterday”). The assistant **only** answers from the channel’s actual messages—no guessing.\n"
          },
          "typeVersion": 1
        },
        {
          "id": "edca3251-40b1-441c-a4f4-87940abdb157",
          "name": "Slack History",
          "type": "n8n-nodes-base.slackTool",
          "position": [
            672,
            -832
          ],
          "webhookId": "53101cda-61c3-4381-bce3-8ea37fd1ebd7",
          "parameters": {
            "filters": {},
            "resource": "channel",
            "channelId": {
              "__rl": true,
              "mode": "list",
              "value": "C04FXLG2YRJ",
              "cachedResultName": "general"
            },
            "operation": "history",
            "returnAll": true
          },
          "credentials": {
            "slackApi": {
              "id": "credential-id",
              "name": "slackApi Credential"
            }
          },
          "typeVersion": 2.3
        },
        {
          "id": "c3dfd3e0-4f0d-41ee-a703-bd9d6fcd7e8f",
          "name": "OpenAI Chat Model",
          "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
          "position": [
            240,
            -736
          ],
          "parameters": {
            "model": {
              "__rl": true,
              "mode": "list",
              "value": "gpt-4o-mini",
              "cachedResultName": "gpt-4o-mini"
            },
            "options": {}
          },
          "credentials": {
            "openAiApi": {
              "id": "credential-id",
              "name": "openAiApi Credential"
            }
          },
          "typeVersion": 1.2
        },
        {
          "id": "df01d3a5-ea81-4d7c-b82f-dee98257a172",
          "name": "Sticky Note54",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            128,
            -912
          ],
          "parameters": {
            "color": 3,
            "width": 288,
            "height": 304,
            "content": "### 1️⃣ Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys)  \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview)  \n3. Add funds to your billing account  \n4. Copy your API key into the **OpenAI credentials** in n8n  "
          },
          "typeVersion": 1
        }
      ],
      "pinData": {},
      "connections": {
        "Slack History": {
          "ai_tool": [
            [
              {
                "node": "Slack Channel Chatbot",
                "type": "ai_tool",
                "index": 0
              }
            ]
          ]
        },
        "Chat with Slack": {
          "main": [
            [
              {
                "node": "Slack Channel Chatbot",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "OpenAI Chat Model": {
          "ai_languageModel": [
            [
              {
                "node": "Slack Channel Chatbot",
                "type": "ai_languageModel",
                "index": 0
              }
            ]
          ]
        }
      }
    },
    "lastUpdatedBy": 29,
    "workflowInfo": {
      "nodeCount": 9,
      "nodeTypes": {
        "n8n-nodes-base.slackTool": {
          "count": 1
        },
        "n8n-nodes-base.stickyNote": {
          "count": 5
        },
        "@n8n/n8n-nodes-langchain.agent": {
          "count": 1
        },
        "@n8n/n8n-nodes-langchain.chatTrigger": {
          "count": 1
        },
        "@n8n/n8n-nodes-langchain.lmChatOpenAi": {
          "count": 1
        }
      }
    },
    "status": "published",
    "user": {
      "name": "Robert Breen",
      "username": "rbreen",
      "bio": "Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.",
      "verified": true,
      "links": [
        "https://ynteractive.com/"
      ],
      "avatar": "https://gravatar.com/avatar/15bb5ad97bad47ca2079e1fa123a8287000c72c86498c90043f70ec2adab05f3?r=pg&d=retro&size=200"
    },
    "nodes": [
      {
        "id": 565,
        "icon": "fa:sticky-note",
        "name": "n8n-nodes-base.stickyNote",
        "codex": {
          "data": {
            "alias": [
              "Comments",
              "Notes",
              "Sticky"
            ],
            "categories": [
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0",
            "subcategories": {
              "Core Nodes": [
                "Helpers"
              ]
            }
          }
        },
        "group": "[\"input\"]",
        "defaults": {
          "name": "Sticky Note",
          "color": "#FFD233"
        },
        "iconData": {
          "icon": "sticky-note",
          "type": "icon"
        },
        "displayName": "Sticky Note",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      },
      {
        "id": 1119,
        "icon": "fa:robot",
        "name": "@n8n/n8n-nodes-langchain.agent",
        "codex": {
          "data": {
            "alias": [
              "LangChain",
              "Chat",
              "Conversational",
              "Plan and Execute",
              "ReAct",
              "Tools"
            ],
            "resources": {
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/"
                }
              ]
            },
            "categories": [
              "AI",
              "Langchain"
            ],
            "subcategories": {
              "AI": [
                "Agents",
                "Root Nodes"
              ]
            }
          }
        },
        "group": "[\"transform\"]",
        "defaults": {
          "name": "AI Agent",
          "color": "#404040"
        },
        "iconData": {
          "icon": "robot",
          "type": "icon"
        },
        "displayName": "AI Agent",
        "typeVersion": 3,
        "nodeCategories": [
          {
            "id": 25,
            "name": "AI"
          },
          {
            "id": 26,
            "name": "Langchain"
          }
        ]
      },
      {
        "id": 1153,
        "icon": "file:openAiLight.svg",
        "name": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
        "codex": {
          "data": {
            "resources": {
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatopenai/"
                }
              ]
            },
            "categories": [
              "AI",
              "Langchain"
            ],
            "subcategories": {
              "AI": [
                "Language Models",
                "Root Nodes"
              ],
              "Language Models": [
                "Chat Models (Recommended)"
              ]
            }
          }
        },
        "group": "[\"transform\"]",
        "defaults": {
          "name": "OpenAI Chat Model"
        },
        "iconData": {
          "type": "file",
          "fileBuffer": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTM2Ljg2NzEgMTYuMzcxOEMzNy43Nz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OS4wODQxM0MxMy44MjY2IDkuMzE1MzggMTMuNTc2NiA5Ljc0Nzg5IDEzLjU3OTEgMTAuMjE2N0wxMy41NzQxIDIxLjQ0MDZWMjEuNDQzMVpNMTUuNDAyOSAxNy41MDA2TDE5LjczNDIgMTQuOTk5M0wyNC4wNjU1IDE3LjQ5OTNWMjIuNTAwN0wxOS43MzQyIDI1LjAwMDdMMTUuNDAyOSAyMi41MDA3VjE3LjUwMDZaIiBmaWxsPSIjN0Q3RDg3Ii8+Cjwvc3ZnPgo="
        },
        "displayName": "OpenAI Chat Model",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 25,
            "name": "AI"
          },
          {
            "id": 26,
            "name": "Langchain"
          }
        ]
      },
      {
        "id": 1247,
        "icon": "fa:comments",
        "name": "@n8n/n8n-nodes-langchain.chatTrigger",
        "codex": {
          "data": {
            "resources": {
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.chattrigger/"
                }
              ]
            },
            "categories": [
              "Core Nodes",
              "Langchain"
            ]
          }
        },
        "group": "[\"trigger\"]",
        "defaults": {
          "name": "When chat message received"
        },
        "iconData": {
          "icon": "comments",
          "type": "icon"
        },
        "displayName": "Chat Trigger",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          },
          {
            "id": 26,
            "name": "Langchain"
          }
        ]
      }
    ],
    "categories": [
      {
        "id": 48,
        "name": "AI RAG"
      },
      {
        "id": 51,
        "name": "Multimodal AI"
      }
    ],
    "image": []
  }
}