8
n8n 中文网amn8n.com

服务健康监控与重试 V010925

中级

这是一个DevOps, Multimodal AI领域的自动化工作流,包含 9 个节点。主要使用 If, Wait, Slack, HttpRequest, ScheduleTrigger 等节点。 具有双重验证和Slack告警的服务健康监控

前置要求
  • Slack Bot Token 或 Webhook URL
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "ADc81sc252y5DJQo",
  "meta": {
    "instanceId": "4655497243705f66b47991d9dbe9a9222e8444b5c2782e466f572ff93867cb4c",
    "templateCredsSetupCompleted": true
  },
  "name": "服务健康监控与重试 V010925",
  "tags": [
    {
      "id": "2BC0mR6o9mZfw0Ry",
      "name": "uptime",
      "createdAt": "2025-09-01T17:36:33.786Z",
      "updatedAt": "2025-09-01T17:36:33.786Z"
    },
    {
      "id": "5slqRjZCJR1hy0fc",
      "name": "monitoring",
      "createdAt": "2025-09-01T17:36:27.812Z",
      "updatedAt": "2025-09-01T17:36:27.812Z"
    },
    {
      "id": "7ASMGI4lVr4Eo8rL",
      "name": "tuguidragos.com",
      "createdAt": "2025-08-23T19:10:40.177Z",
      "updatedAt": "2025-08-23T19:10:40.177Z"
    },
    {
      "id": "KBQZBD4R6LVuuFK2",
      "name": "slack-alerts",
      "createdAt": "2025-09-01T16:14:22.027Z",
      "updatedAt": "2025-09-01T16:14:22.027Z"
    },
    {
      "id": "NtEM4qJBPpIvfcPu",
      "name": "automation",
      "createdAt": "2025-08-31T21:12:32.130Z",
      "updatedAt": "2025-08-31T21:12:32.130Z"
    },
    {
      "id": "vvwl4Tq3LGKxOPea",
      "name": "error-handling",
      "createdAt": "2025-09-01T17:36:40.590Z",
      "updatedAt": "2025-09-01T17:36:40.590Z"
    }
  ],
  "nodes": [
    {
      "id": "2a8de1f3-4823-47e4-a1c9-e5210bad1788",
      "name": "检查间隔",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        -368
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5b0eb832-e1c3-4270-a891-8db5b07def07",
      "name": "首次检查",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        -368
      ],
      "parameters": {
        "url": "https://httpbin.org/status/400",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "fullResponse": true
            }
          }
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "6613ec70-0e0b-40b3-85fa-161d2bb2d870",
      "name": "检查状态",
      "type": "n8n-nodes-base.if",
      "position": [
        448,
        -368
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f6ccb555-8951-40a1-bc0f-918731354227",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json[\"statusCode\"] }}",
              "rightValue": 400
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "35dbf021-4513-4557-a6d5-d99a460bc988",
      "name": "重新检查延迟",
      "type": "n8n-nodes-base.wait",
      "position": [
        672,
        -368
      ],
      "webhookId": "4d07628f-2f2a-4039-81ae-e45d78982c80",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "5c80525f-87fa-44e2-9368-16bc7200b5a5",
      "name": "第二次检查",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        896,
        -368
      ],
      "parameters": {
        "url": "https://httpbin.org/status/400",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "fullResponse": true
            }
          }
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "c76666d2-9cf1-4e62-86e4-6c22ec562716",
      "name": "确认故障",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        -368
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f6ccb555-8951-40a1-bc0f-918731354227",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json[\"statusCode\"] }}",
              "rightValue": 400
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "792f2a3b-32b0-4b9e-b057-0b93cece27b6",
      "name": "发送警报到 Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1344,
        -368
      ],
      "webhookId": "738bd1c5-e87d-4dd4-951e-8485c5cb01ac",
      "parameters": {
        "text": "=🚨 URGENT: Service check failed twice in a row!   \n Status: {{$json[\"statusCode\"]}}\n Message: {{$json[\"statusMessage\"]}}  \n Time: {{$json[\"headers\"][\"date\"]}}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "ID"
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "id": "XuUwy2Lth9glqHbY",
          "name": "Slack Test"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "20879940-5317-49a8-bbb7-c47924bf0e5f",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -560
      ],
      "parameters": {
        "color": 5,
        "width": 432,
        "height": 144,
        "content": "### 工作原理"
      },
      "typeVersion": 1
    },
    {
      "id": "c2536e52-55cc-495c-846e-f6d2154e25cc",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -192
      ],
      "parameters": {
        "color": 5,
        "width": 464,
        "height": 144,
        "content": "### 设置步骤"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6a1bea4d-fca8-4f7d-95c9-fe7b31ba3f52",
  "connections": {
    "First Check": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Status": {
      "main": [
        [
          {
            "node": "Recheck Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Second Check": {
      "main": [
        [
          {
            "node": "Confirm Failure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recheck Delay": {
      "main": [
        [
          {
            "node": "Second Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Interval": {
      "main": [
        [
          {
            "node": "First Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Confirm Failure": {
      "main": [
        [
          {
            "node": "Send Alert to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 开发运维, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量9
分类2
节点类型6
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Țugui Dragoș

Țugui Dragoș

@tuguidragos

Automation consultant focused on revenue workflows with n8n, GoHighLevel, and AI. Specializing in voice bots, lead generation & follow-up systems.

外部链接
在 n8n.io 查看

分享此工作流