Slack消息批量清理器
高级
这是一个IT Ops领域的自动化工作流,包含 48 个节点。主要使用 If, Set, Code, Wait, Slack 等节点。 使用智能筛选和确认功能批量删除Slack消息
前置要求
- •Slack Bot Token 或 Webhook URL
- •HTTP Webhook 端点(n8n 会自动生成)
分类
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "v4RBwo9l0JrOuBCv",
"meta": {
"instanceId": "0d1aac533628b88b03392640352a107d7fb2b1999c77dfa29323f9815e9d2e71",
"templateCredsSetupCompleted": true
},
"name": "清理器绝地实时",
"tags": [],
"nodes": [
{
"id": "975ba945-ce00-45e2-bf2a-aeaf3f1d5012",
"name": "解析命令",
"type": "n8n-nodes-base.code",
"position": [
-420,
560
],
"parameters": {},
"typeVersion": 2
},
{
"id": "81524a01-a9b4-4802-911a-c32e1ed9b62b",
"name": "检查是否为有效命令",
"type": "n8n-nodes-base.if",
"position": [
20,
560
],
"parameters": {},
"typeVersion": 2
},
{
"id": "ad2945c8-87c9-47d0-a1bf-a6629c895a96",
"name": "发送错误消息",
"type": "n8n-nodes-base.slack",
"position": [
920,
760
],
"webhookId": "6919f962-1796-4dd8-99ab-7ec4ed2ab66e",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "1a951ca1-f0de-49d8-8ea4-40b28770f9c4",
"name": "获取频道消息",
"type": "n8n-nodes-base.slack",
"onError": "continueErrorOutput",
"position": [
260,
340
],
"webhookId": "41292ab0-522c-49d7-ba73-37b14bfd2572",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "62a04f05-8788-47ce-b493-38b9548af0fe",
"name": "按搜索词过滤消息",
"type": "n8n-nodes-base.code",
"position": [
480,
340
],
"parameters": {},
"typeVersion": 2
},
{
"id": "e6901c01-faef-47ad-834d-de3e033d9660",
"name": "找到消息?",
"type": "n8n-nodes-base.if",
"position": [
700,
340
],
"parameters": {},
"typeVersion": 2
},
{
"id": "67ce1fe7-1f65-42d9-8e2a-1ede6b0bb72c",
"name": "未找到消息",
"type": "n8n-nodes-base.slack",
"position": [
920,
560
],
"webhookId": "f3cbf8c7-77f2-43d3-886a-16e40ca76627",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "6b243ff0-cda8-4143-add1-98da19dcd5e0",
"name": "发送确认消息",
"type": "n8n-nodes-base.slack",
"position": [
920,
320
],
"webhookId": "ac43ceb2-819e-4a86-8238-ccaf4f89bc9c",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "0af3cb87-ad7d-4490-bc60-c499fb0b6be0",
"name": "存储待删除",
"type": "n8n-nodes-base.code",
"position": [
920,
120
],
"parameters": {},
"typeVersion": 2
},
{
"id": "84440246-0f59-421b-9560-4c00d988cb4c",
"name": "删除或取消?",
"type": "n8n-nodes-base.if",
"position": [
920,
-80
],
"parameters": {},
"typeVersion": 2
},
{
"id": "54662021-94f7-472d-beb8-72613de271d9",
"name": "发送取消消息",
"type": "n8n-nodes-base.slack",
"position": [
1360,
120
],
"webhookId": "e635fba5-89ba-4252-99be-a0056ce0e691",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "ad54dbb5-ac41-490a-bf8f-a8e1e59d6611",
"name": "循环遍历消息",
"type": "n8n-nodes-base.splitInBatches",
"position": [
2460,
-100
],
"parameters": {},
"typeVersion": 3
},
{
"id": "48d391e8-1da3-4678-b0b2-169b41cde1d0",
"name": "删除间隔等待",
"type": "n8n-nodes-base.wait",
"position": [
2680,
-320
],
"webhookId": "9787bbe2-f0df-425a-b66b-6d5bfc83c5d9",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "87514904-52f8-40e9-aaa5-13364d8a723d",
"name": "删除消息",
"type": "n8n-nodes-base.slack",
"onError": "continueErrorOutput",
"position": [
2880,
-80
],
"webhookId": "16deb0b5-acc3-4518-8d02-0dca4b2afcf9",
"parameters": {},
"retryOnFail": true,
"typeVersion": 2.3,
"alwaysOutputData": false
},
{
"id": "02333851-d886-4630-a9d9-aa533ae7564b",
"name": "发送完成消息",
"type": "n8n-nodes-base.slack",
"position": [
3140,
200
],
"webhookId": "4b565051-ea07-4f5b-988b-823b86c8cda4",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "124261cc-8a44-4af5-b8b5-424e723ef7ee",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-1140,
200
],
"webhookId": "8c1fb8b9-6b44-4152-97b5-92a629db65db",
"parameters": {},
"typeVersion": 2
},
{
"id": "bed31a19-8a09-4ab7-865e-ae866e85fc6c",
"name": "响应 Webhook",
"type": "n8n-nodes-base.code",
"position": [
-920,
200
],
"parameters": {},
"typeVersion": 2
},
{
"id": "aba0cf53-473b-46cb-aa85-4052ec4209d3",
"name": "检查用户消息",
"type": "n8n-nodes-base.code",
"position": [
-400,
-60
],
"parameters": {},
"typeVersion": 2
},
{
"id": "2b162d2a-8790-407f-8f2f-e547d33a4bdf",
"name": "条件判断1",
"type": "n8n-nodes-base.if",
"position": [
480,
-60
],
"parameters": {},
"typeVersion": 2.2
},
{
"id": "a222e7a4-759a-4be7-9912-cbf7e54f51ad",
"name": "代码计数",
"type": "n8n-nodes-base.code",
"position": [
2880,
200
],
"parameters": {},
"typeVersion": 2
},
{
"id": "ecf4fa44-d4dd-4066-8c5c-6a82bf017e8e",
"name": "等待",
"type": "n8n-nodes-base.wait",
"position": [
3320,
200
],
"webhookId": "535c79f2-09d4-4a97-aa74-6b2588328a7b",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "cf27d860-29c1-4bb5-8583-942ef869c0dd",
"name": "错误报告",
"type": "n8n-nodes-base.slack",
"position": [
260,
120
],
"webhookId": "3e80a1be-63dd-4ed0-8ca6-372074fd0b66",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "248ebe61-01d9-41ca-9aee-719610851817",
"name": "解析设置",
"type": "n8n-nodes-base.set",
"position": [
-200,
560
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "205c94b7-64db-48ef-8344-119e75fc2be4",
"name": "分支",
"type": "n8n-nodes-base.switch",
"position": [
-720,
200
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "8d01fdc2-8ff4-4e72-8b7b-3d3e70523516",
"name": "清理工作流消息",
"type": "n8n-nodes-base.code",
"position": [
3540,
200
],
"parameters": {},
"typeVersion": 2
},
{
"id": "4b6f64dd-55a6-49e4-89d9-42cc259d3e6e",
"name": "遍历项目",
"type": "n8n-nodes-base.splitInBatches",
"position": [
3760,
200
],
"parameters": {},
"typeVersion": 3
},
{
"id": "47feca47-9d1e-4e0b-8fc0-74f90a16b89b",
"name": "删除工作流消息",
"type": "n8n-nodes-base.slack",
"onError": "continueErrorOutput",
"position": [
4020,
220
],
"webhookId": "16deb0b5-acc3-4518-8d02-0dca4b2afcf9",
"parameters": {},
"retryOnFail": true,
"typeVersion": 2.3,
"alwaysOutputData": false
},
{
"id": "6817ed58-23c9-4429-8783-7bdc0a14ca47",
"name": "删除错误最终",
"type": "n8n-nodes-base.slack",
"position": [
3540,
-80
],
"webhookId": "2a3d796d-7bae-4df3-ba84-31b90bea931f",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "db924753-78c2-4e64-844c-828b8f044977",
"name": "等待错误最终",
"type": "n8n-nodes-base.wait",
"position": [
3320,
-80
],
"webhookId": "a85f9a89-ade0-4793-98a8-1a220706d87c",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "ecb2798a-644f-4d39-85c1-41d4f2622d7f",
"name": "发布错误最终",
"type": "n8n-nodes-base.slack",
"position": [
3140,
-80
],
"webhookId": "e75ccc20-ec55-4fb1-8dda-2a3e52fe5655",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "82ce2cda-85e8-4da1-99ed-32e983e79b10",
"name": "等待错误最终",
"type": "n8n-nodes-base.wait",
"position": [
1140,
760
],
"webhookId": "5a71ca04-97e6-4273-8832-af4cd07742e0",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "cf7be54f-24f8-4f14-bec6-aa96c8df9697",
"name": "删除错误消息",
"type": "n8n-nodes-base.slack",
"position": [
1360,
760
],
"webhookId": "2a3d796d-7bae-4df3-ba84-31b90bea931f",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "2e876cef-2e33-411f-ae48-ed858c0210a4",
"name": "等待无消息最终",
"type": "n8n-nodes-base.wait",
"position": [
1140,
560
],
"webhookId": "5a71ca04-97e6-4273-8832-af4cd07742e0",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "8dc45a00-8f8e-4e37-b864-6f4801170a9c",
"name": "删除无消息",
"type": "n8n-nodes-base.slack",
"position": [
1360,
560
],
"webhookId": "2a3d796d-7bae-4df3-ba84-31b90bea931f",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "eaf0836a-9c73-43f7-a4bc-1eae0bd64a4b",
"name": "等待取消消息",
"type": "n8n-nodes-base.wait",
"position": [
1600,
120
],
"webhookId": "5a71ca04-97e6-4273-8832-af4cd07742e0",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "4d1e3c2e-caa2-4be3-a92f-8611eca28c9d",
"name": "删除取消消息",
"type": "n8n-nodes-base.slack",
"position": [
1860,
120
],
"webhookId": "2a3d796d-7bae-4df3-ba84-31b90bea931f",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "76db469f-e16e-4e49-8561-f6851b07ab9b",
"name": "等待错误报告",
"type": "n8n-nodes-base.wait",
"position": [
480,
120
],
"webhookId": "5a71ca04-97e6-4273-8832-af4cd07742e0",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "0c1ced79-46a3-4a1e-a43c-65ae087c4d03",
"name": "删除报告错误",
"type": "n8n-nodes-base.slack",
"position": [
700,
120
],
"webhookId": "2a3d796d-7bae-4df3-ba84-31b90bea931f",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "fe88f35c-ea43-46b8-8a48-4cf93e264a09",
"name": "删除进度消息",
"type": "n8n-nodes-base.slack",
"position": [
1860,
-300
],
"webhookId": "2a3d796d-7bae-4df3-ba84-31b90bea931f",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "1d4d0393-c8c6-4959-83b1-f181911fef07",
"name": "等待进度消息",
"type": "n8n-nodes-base.wait",
"position": [
1600,
-300
],
"webhookId": "a0b30385-34ef-4a20-9770-b05e5e31728b",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "79d270f1-c453-420d-a64a-a360617bc795",
"name": "发送进度确认",
"type": "n8n-nodes-base.slack",
"position": [
1360,
-300
],
"webhookId": "f74727ec-7e3f-43b9-aaf2-290c5c554b59",
"parameters": {},
"executeOnce": true,
"typeVersion": 2.3
},
{
"id": "0bd521fc-9b23-41bf-961e-60343513c7b3",
"name": "等待确认",
"type": "n8n-nodes-base.wait",
"position": [
1140,
320
],
"webhookId": "5a71ca04-97e6-4273-8832-af4cd07742e0",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "a231a659-2584-4ac6-91fa-238d4faf7744",
"name": "删除确认",
"type": "n8n-nodes-base.slack",
"position": [
1360,
320
],
"webhookId": "2a3d796d-7bae-4df3-ba84-31b90bea931f",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "8df0723f-8aae-4893-b2da-f17c45becabe",
"name": "说明消息",
"type": "n8n-nodes-base.slack",
"position": [
-400,
200
],
"webhookId": "67c86156-689a-467b-a0a1-53c18ff08380",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "2a47706f-1a44-475a-8e9a-e47218fa5d07",
"name": "等待1",
"type": "n8n-nodes-base.wait",
"position": [
-180,
200
],
"webhookId": "c751bd2b-8010-463f-a8b7-d2a61a8991ce",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "021c1e19-7f47-4c30-b916-e9ff0c39e033",
"name": "删除说明",
"type": "n8n-nodes-base.slack",
"position": [
40,
200
],
"webhookId": "2a3d796d-7bae-4df3-ba84-31b90bea931f",
"parameters": {},
"typeVersion": 2.3
},
{
"id": "5c706b73-877f-441a-b218-eeaa5dcb2fd0",
"name": "存储消息信息",
"type": "n8n-nodes-base.code",
"position": [
2340,
-300
],
"parameters": {},
"typeVersion": 2
},
{
"id": "c13388fe-0cc0-4651-87cd-c186a9516d55",
"name": "准备删除节点消息",
"type": "n8n-nodes-base.code",
"position": [
2120,
-300
],
"parameters": {},
"typeVersion": 2
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "996a1fbc-e5cd-4517-b501-d417458ee2a3",
"connections": {
"If1": {
"main": [
[
{
"node": "Delete or Cancel?",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Cancel Message",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Clean Up Workflow Messages",
"type": "main",
"index": 0
}
]
]
},
"Wait1": {
"main": [
[
{
"node": "Delete Instruction",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Check User Message",
"type": "main",
"index": 0
}
],
[
{
"node": "Instruction Message",
"type": "main",
"index": 0
}
],
[
{
"node": "Parse Command",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"Prase Set": {
"main": [
[
{
"node": "Check if Valid Command",
"type": "main",
"index": 0
}
]
]
},
"Wait Conf": {
"main": [
[
{
"node": "Delete Conf",
"type": "main",
"index": 0
}
]
]
},
"Code Count": {
"main": [
[
{
"node": "Send Completion Message",
"type": "main",
"index": 0
}
]
]
},
"Error Report": {
"main": [
[
{
"node": "Wait Error Report",
"type": "main",
"index": 0
}
]
]
},
"Parse Command": {
"main": [
[
{
"node": "Prase Set",
"type": "main",
"index": 0
}
]
]
},
"Delete Message": {
"main": [
[
{
"node": "Loop Over Messages",
"type": "main",
"index": 0
}
],
[
{
"node": "Post Error Final",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Delete Workflow Messages",
"type": "main",
"index": 0
}
]
]
},
"Messages Found?": {
"main": [
[
{
"node": "Store Pending Deletion",
"type": "main",
"index": 0
},
{
"node": "Send Confirmation Message",
"type": "main",
"index": 0
}
],
[
{
"node": "No Messages Found",
"type": "main",
"index": 0
}
]
]
},
"Wait No.M Final": {
"main": [
[
{
"node": "Delete No Messages",
"type": "main",
"index": 0
}
]
]
},
"Wait Progress M": {
"main": [
[
{
"node": "Delete Progress M",
"type": "main",
"index": 0
}
]
]
},
"Post Error Final": {
"main": [
[
{
"node": "Wait for Error Final",
"type": "main",
"index": 0
}
]
]
},
"Wait Error Final": {
"main": [
[
{
"node": "Delete Error Message",
"type": "main",
"index": 0
}
]
]
},
"Delete or Cancel?": {
"main": [
[
{
"node": "Loop Over Messages",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Progress Confirmation",
"type": "main",
"index": 0
}
]
]
},
"No Messages Found": {
"main": [
[
{
"node": "Wait No.M Final",
"type": "main",
"index": 0
}
]
]
},
"Wait Error Report": {
"main": [
[
{
"node": "Delete Report Error",
"type": "main",
"index": 0
}
]
]
},
"Check User Message": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
]
]
},
"Delete Error Final": {
"main": [
[]
]
},
"Loop Over Messages": {
"main": [
[
{
"node": "Code Count",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait Between Deletes",
"type": "main",
"index": 0
}
]
]
},
"Respond to Webhook": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Send Error Message": {
"main": [
[
{
"node": "Wait Error Final",
"type": "main",
"index": 0
}
]
]
},
"Instruction Message": {
"main": [
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
]
]
},
"Send Cancel Message": {
"main": [
[
{
"node": "Wait Cancel Message",
"type": "main",
"index": 0
}
]
]
},
"Wait Cancel Message": {
"main": [
[
{
"node": "Delete Cancel Message",
"type": "main",
"index": 0
}
]
]
},
"Get Channel Messages": {
"main": [
[
{
"node": "Filter Messages by Search Term",
"type": "main",
"index": 0
}
],
[
{
"node": "Error Report",
"type": "main",
"index": 0
}
]
]
},
"Wait Between Deletes": {
"main": [
[
{
"node": "Delete Message",
"type": "main",
"index": 0
}
]
]
},
"Wait for Error Final": {
"main": [
[
{
"node": "Delete Error Final",
"type": "main",
"index": 0
}
]
]
},
"Check if Valid Command": {
"main": [
[
{
"node": "Get Channel Messages",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Error Message",
"type": "main",
"index": 0
}
]
]
},
"Store Pending Deletion": {
"main": [
[]
]
},
"Send Completion Message": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Delete Workflow Messages": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
],
[]
]
},
"Send Confirmation Message": {
"main": [
[
{
"node": "Wait Conf",
"type": "main",
"index": 0
}
]
]
},
"Clean Up Workflow Messages": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Send Progress Confirmation": {
"main": [
[
{
"node": "Wait Progress M",
"type": "main",
"index": 0
}
]
]
},
"Filter Messages by Search Term": {
"main": [
[
{
"node": "Messages Found?",
"type": "main",
"index": 0
}
]
]
},
"Prepare Messages for Deletion Node": {
"main": [
[
{
"node": "Store Message Info",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - IT 运维
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
AI智能助手:与Supabase存储和Google Drive文件对话
AI智能助手:与Supabase存储和Google Drive文件对话
If
Set
Wait
+20
62 节点Mark Shcherbakov
工程
基于AI的Loom视频问答(Gemini-2.5和Slack通知)
基于AI的Loom视频问答:使用Gemini-2.5和Slack通知
If
Set
Code
+7
24 节点GiovanniSegar
人工智能
↔️ Airtable批量处理
Airtable批量更新/插入行(发送更快+节省API调用请求)
If
Set
Code
+12
35 节点Simon Mayerhofer
IT 运维
使用GPT-4.1、Outlook和Mem.ai自动化Microsoft Teams会议分析
使用GPT-4.1、Outlook和Mem.ai自动化Microsoft Teams会议分析
If
Set
Code
+19
61 节点Wayne Simpson
人力资源
自动化Airtable到Postgres迁移,使用n8n
自动化Airtable到Postgres迁移,使用n8n
If
Set
Code
+9
66 节点Imperol
IT 运维
Google 日历到 Sheets 模板 v1.0
自动将 Google 日历事件同步到 Google Sheets 跟踪器
If
Set
Code
+7
20 节点Alex Halfborg
IT 运维
工作流信息
难度等级
高级
节点数量48
分类1
节点类型8
作者
Elie Kattar
@solutionflowsMultimedia Consultant Working in the Field Since 2009, Creating Simple Solutions to speed-up day-to-day tasks
外部链接
在 n8n.io 查看 →
分享此工作流