使用 OpenAI 通过自然语言查询 Slack 频道历史记录
中级
这是一个AI RAG, Multimodal AI领域的自动化工作流,包含 9 个节点。主要使用 SlackTool, Agent, ChatTrigger, LmChatOpenAi 等节点。 使用 OpenAI 通过自然语言查询 Slack 频道历史记录
前置要求
- •Slack Bot Token 或 Webhook URL
- •OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "e2c58c94-6864-431d-a5e3-56ea2757cf10",
"name": "Slack频道聊天机器人",
"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": "与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": "便签53",
"type": "n8n-nodes-base.stickyNote",
"position": [
-256,
-1344
],
"parameters": {
"color": 7,
"width": 224,
"height": 560,
"content": ""
},
"typeVersion": 1
},
{
"id": "3e18db06-f194-4d48-b861-d4724cd83e22",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-816,
-1568
],
"parameters": {
"width": 400,
"height": 1056,
"content": "## ⚙️ 设置说明"
},
"typeVersion": 1
},
{
"id": "113a5a1d-3afb-4bbf-81c6-0e6602121f98",
"name": "便签52",
"type": "n8n-nodes-base.stickyNote",
"position": [
592,
-1360
],
"parameters": {
"color": 3,
"width": 224,
"height": 640,
"content": "### 2️⃣ 连接Slack API"
},
"typeVersion": 1
},
{
"id": "922d2b75-5e58-4e60-a3a3-84ad97ec63f2",
"name": "便签50",
"type": "n8n-nodes-base.stickyNote",
"position": [
-368,
-1568
],
"parameters": {
"color": 7,
"width": 1248,
"height": 1056,
"content": "# 💬 Slack频道聊天机器人 (n8n + OpenAI)"
},
"typeVersion": 1
},
{
"id": "edca3251-40b1-441c-a4f4-87940abdb157",
"name": "Slack历史记录",
"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": "WOPShnC1AJqiWjZK",
"name": "Slack account 11"
}
},
"typeVersion": 2.3
},
{
"id": "c3dfd3e0-4f0d-41ee-a703-bd9d6fcd7e8f",
"name": "OpenAI 聊天模型",
"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": "4l6TDfLZVFS24g3X",
"name": "OpenAi account 4"
}
},
"typeVersion": 1.2
},
{
"id": "df01d3a5-ea81-4d7c-b82f-dee98257a172",
"name": "便签54",
"type": "n8n-nodes-base.stickyNote",
"position": [
128,
-912
],
"parameters": {
"color": 3,
"width": 288,
"height": 304,
"content": "### 1️⃣ 设置 OpenAI 连接"
},
"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
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - AI RAG 检索增强, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用GPT-4o-mini进行Pipedrive潜在客户自然语言问答
使用GPT-4o-mini进行Pipedrive潜在客户自然语言问答
Pipedrive Tool
Agent
Chat Trigger
+2
8 节点Robert Breen
AI RAG 检索增强
使用 GPT-4o 通过自然语言查询搜索 Outlook 邮件
使用 GPT-4o 通过自然语言查询搜索 Outlook 邮件
Merge
Aggregate
Agent
+6
17 节点Robert Breen
AI RAG 检索增强
AI网站聊天机器人 - GPT与Google表格CRM线索收集
集成GPT和Google表格的AI网站聊天机器人 - CRM线索收集系统
Code
Google Sheets
Agent
+7
14 节点Robert Breen
潜在客户开发
使用GPT-5 Nano多语言聊天机器人自动处理电商客户支持
使用GPT-5 Nano多语言聊天机器人自动处理电商客户支持
Set
Merge
Split Out
+6
13 节点Robert Breen
AI 聊天机器人
博客写作与编辑器
基于Google Sheets记忆的博客写作与编辑器 (GPT-4)
If
Code
Filter
+10
18 节点Robert Breen
内容创作
基于 GPT-5 Mini 的 Google Sheets 对话式数据分析
基于 GPT-5 Mini 的 Google Sheets 对话式数据分析
Agent
Google Sheets Tool
Chat Trigger
+3
10 节点Robert Breen
文档提取
工作流信息
难度等级
中级
节点数量9
分类2
节点类型5
作者
Robert Breen
@rbreenProfessional 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.
外部链接
在 n8n.io 查看 →
分享此工作流