{
  "id": "ADc81sc252y5DJQo",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Service Health Monitor with Retry 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": "Check Interval",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        -368
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5b0eb832-e1c3-4270-a891-8db5b07def07",
      "name": "First Check",
      "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": "Check Status",
      "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": "Recheck Delay",
      "type": "n8n-nodes-base.wait",
      "position": [
        672,
        -368
      ],
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "5c80525f-87fa-44e2-9368-16bc7200b5a5",
      "name": "Second Check",
      "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": "Confirm Failure",
      "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": "Send Alert to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1344,
        -368
      ],
      "parameters": {
        "text": "=\ud83d\udea8 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": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "20879940-5317-49a8-bbb7-c47924bf0e5f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -560
      ],
      "parameters": {
        "color": 5,
        "width": 432,
        "height": 144,
        "content": "### How it works\n- Runs scheduled HTTP health checks  \n- Waits and retries before confirming a failure  \n- Sends Slack alerts only if the service fails twice in a row  \n- Prevents false positives and reduces alert fatigue  "
      },
      "typeVersion": 1
    },
    {
      "id": "c2536e52-55cc-495c-846e-f6d2154e25cc",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -192
      ],
      "parameters": {
        "color": 5,
        "width": 464,
        "height": 144,
        "content": "### Setup steps\n1. Add your service URL(s) in the HTTP Request node  \n2. Configure your Slack Bot Token in the Send Alert to Slack node  \n3. Set the interval for checks in the Check Interval node  \n4. Save & activate the workflow to start monitoring  "
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "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
          }
        ]
      ]
    }
  }
}