Crafted by Ritik Makhija — Automations · AI Workflows · Open Source Advocate

Browse 5,000+ n8n Automation Templates

DM “PROJECT” on Instagram to collaborate on custom automation

← Back

Create Automated System Health Monitoring Alerts

n8n advance / create-automated-system-health-monitoring-alerts.json

Complexity: simpleNodes: 4
alertalertsautomatedbasecheckcreatecreate-automated-system-health-monitoring-alerts.jsonfunctionhealthhttprequestmetricsmonitoringn8nn8n advancenodesopensimpleslackstatuspagesystemthresholdwebhook

Node Overview

Workflow JSON

{
  "name": "create-automated-system-health-monitoring-alerts",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "metrics"
      },
      "id": "m1",
      "name": "Metrics Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        100,
        280
      ]
    },
    {
      "parameters": {
        "functionCode": "\nconst b=$json.body||$json;\nconst metrics=b.metrics||[{name:'cpu',value:0,host:'unknown'}];\nconst thresholds={cpu:85, mem:90, disk:90, latency:300};\nconst alerts=[];\nfor(const m of metrics){\n  const n=(m.name||'').toLowerCase();\n  const v=+m.value;\n  const th=thresholds[n];\n  if(th!==undefined && v>=th) alerts.push({host:m.host||'n/a', metric:n, value:v, threshold:th});\n}\nreturn alerts.length?alerts.map(a=>({json:a})):[{json:{info:'no_alerts'}}];\n"
      },
      "id": "m2",
      "name": "Threshold Check",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        320,
        280
      ]
    },
    {
      "parameters": {
        "channel": "#ops",
        "text": "⚠️ {{$json.metric.toUpperCase()}} {{$json.value}}% on {{$json.host}} (threshold {{$json.threshold}}%)"
      },
      "id": "m3",
      "name": "Slack Alert",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        540,
        260
      ]
    },
    {
      "parameters": {
        "url": "https://statuspage.example.com/api/v1/incidents",
        "authentication": "none",
        "jsonParameters": true,
        "options": {
          "headersUi": {
            "parameter": [
              {
                "name": "Authorization",
                "value": "Bearer {{$credentials.statuspageToken}}"
              }
            ]
          }
        },
        "options_json": {
          "name": "={{'Degradation: '+$json.metric+' on '+$json.host}}",
          "status": "investigating"
        }
      },
      "id": "m4",
      "name": "Open Statuspage",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        540,
        380
      ]
    }
  ],
  "connections": {
    "Metrics Webhook": {
      "main": [
        [
          {
            "node": "Threshold Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Threshold Check": {
      "main": [
        [
          {
            "node": "Slack Alert",
            "type": "main",
            "index": 0
          },
          {
            "node": "Open Statuspage",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false
}
Download JSON