Skip to content

In n8n, copy this file and paste it onto the canvas, or use Import from File.

{
  "name": "12 - Uptime Monitor (starter)",
  "nodes": [
    {
      "parameters": {
        "path": "ops/health",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "m12-webhook",
      "name": "Health API",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        200
      ],
      "webhookId": "course-12-health"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "u1",
              "name": "urls",
              "value": "={{ $json.query?.urls ? $json.query.urls.split(',').map(u => u.trim()).filter(Boolean) : ['http://localhost:5678/healthz', 'https://example.com'] }}",
              "type": "array"
            }
          ]
        },
        "options": {}
      },
      "id": "m12-settings",
      "name": "Sites to Check (edit me)",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        100
      ]
    },
    {
      "parameters": {
        "content": "## Your task\n1. **Split Out** the `urls` list into one item per site.\n2. **HTTP Request** each URL with *Full Response* + *Never Error* on, and node Settings → On Error → *Continue*, so dead sites become items instead of crashing the run.\n3. **Evaluate** each: status, ok (2xx/3xx), error message.\n4. **Aggregate**, then build `all_ok`, `down` and an alert text.\n5. Respond **200** if all ok, **503** otherwise. Add a Schedule Trigger (every 5 min) that sends an alert when something's down.\n\nTest: `./test/test.sh`",
        "height": 260,
        "width": 420
      },
      "id": "starter-task-note",
      "name": "Your Task",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -340
      ]
    }
  ],
  "connections": {
    "Health API": {
      "main": [
        [
          {
            "node": "Sites to Check (edit me)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sites to Check (edit me)": {
      "main": [
        []
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  }
}