这个强大的工作流可以自动将各种重要事件发送到您的Slack频道。支持自定义触发条件、富文本消息格式、多频道同时发送以及错误重试机制。非常适合团队协作和监控告警场景。
快速开始
- 1下载工作流文件
- 2在N8N中导入工作流
- 3配置必要的凭据
- 4激活工作流开始使用
工作流JSON
slack-notification-automation.json(91 行)
{
"name": "Slack实时通知自动化",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "webhook",
"responseMode": "lastNode",
"options": {}
},
"id": "8a7b9c3d-1e2f-3a4b-5c6d-7e8f9a0b1c2d",
"name": "Webhook触发器",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
240,
300
],
"webhookId": "slack-webhook-trigger"
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.event }}",
"operation": "equals",
"value2": "error"
}
]
}
},
"id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"name": "条件判断",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
460,
300
]
},
{
"parameters": {
"channel": "#alerts",
"text": "={{ $json.message }}",
"otherOptions": {}
},
"id": "2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
"name": "发送到Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 1,
"position": [
680,
200
],
"credentials": {
"slackApi": {
"id": "1",
"name": "Slack API"
}
}
}
],
"connections": {
"条件判断": {
"main": [
[
{
"node": "发送到Slack",
"type": "main",
"index": 0
}
]
]
},
"Webhook触发器": {
"main": [
[
{
"node": "条件判断",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"id": "1"
}