{
  "id": "YvCR0JYS4JhGD0mD",
  "name": "Realtime Uptime Monitor Report Using Hetrix Tools + Golang WhatsApp",
  "tags": [],
  "nodes": [
    {
      "id": "8fb385de-989b-400d-91c3-367d0d9e09eb",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        0
      ],
      "parameters": {
        "path": "e03dc76d-ccdb-45cd-919f-f9f3fe3e2a20",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "ffc43bb3-26b7-478f-a9cf-f37c0fd7b9d1",
      "name": "If Server Resource Usage Monitoring",
      "type": "n8n-nodes-base.if",
      "position": [
        208,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "56d719dc-4801-4062-8efa-375424bdebe9",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.body.resource_usage }}",
              "rightValue": "website"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "014e813c-1afb-4364-89b7-04405b57928e",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        464,
        -128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d9b583e0-9c10-483b-88d8-25cd9a4b5f9d",
              "name": "body.monitor_name",
              "type": "string",
              "value": "={{ $json.body.monitor_name }}"
            },
            {
              "id": "b217764b-59e0-4674-bd9d-6173d1c459bb",
              "name": "body.resource_usage.resource_type",
              "type": "string",
              "value": "={{ $json.body.resource_usage.resource_type }}"
            },
            {
              "id": "87034a33-79bc-4684-926b-892b22196a6a",
              "name": "body.resource_usage.current_usage",
              "type": "string",
              "value": "={{ $json.body.resource_usage.current_usage }}"
            },
            {
              "id": "1ffb5635-5b7a-48e6-8a1d-51877a7dc22c",
              "name": "body.resource_usage.average_usage",
              "type": "string",
              "value": "={{ $json.body.resource_usage.average_usage }}"
            },
            {
              "id": "26f0fef6-d6f1-49dd-ba34-fd5c20269ca8",
              "name": "body.resource_usage.average_minutes",
              "type": "string",
              "value": "={{ $json.body.resource_usage.average_minutes }}"
            },
            {
              "id": "901a3c50-1407-41fc-aecb-c9c9eaec987f",
              "name": "teks",
              "type": "string",
              "value": "={{ $('Webhook').item.json.body.monitor_name }} \nResource Type : {{ $json.body.resource_usage.resource_type }}\nCurrent Usage : {{ $json.body.resource_usage.current_usage }}\nAverage Usage : {{ $json.body.resource_usage.average_usage }}\nNoticed at : {{ new Date($('Webhook').item.json.body.timestamp * 1000).toLocaleString('en-GB', {      year: 'numeric',      month: '2-digit',      day: '2-digit',      hour: '2-digit',      minute: '2-digit',      second: '2-digit' }) }} (UTC+08:00)"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "fcc99edf-7151-4a5d-bbf0-ac8d2cb43001",
      "name": "Send chat presence typing indicator",
      "type": "@aldinokemal2104/n8n-nodes-gowa.gowa",
      "position": [
        992,
        -16
      ],
      "parameters": {
        "operation": "sendChatPresence",
        "phoneNumber": "=Change me [Whatsapp Number]"
      },
      "credentials": {
        "goWhatsappApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9d3c1d42-f414-4770-af00-de7a61513823",
      "name": "Stop Typing1",
      "type": "@aldinokemal2104/n8n-nodes-gowa.gowa",
      "position": [
        1408,
        -16
      ],
      "parameters": {
        "operation": "sendChatPresence",
        "phoneNumber": "=Change me [Whatsapp Number]",
        "chatPresenceAction": "stop"
      },
      "credentials": {
        "goWhatsappApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1cf5beb3-38d1-4e2d-b257-1aac6eab3121",
      "name": "Send Message1",
      "type": "@aldinokemal2104/n8n-nodes-gowa.gowa",
      "position": [
        1600,
        -16
      ],
      "parameters": {
        "message": "={{ $('Set Message Text').item.json.teks }}",
        "phoneNumber": "=Change me [Whatsapp Number]"
      },
      "credentials": {
        "goWhatsappApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7b8c4fc1-df76-4ad1-b549-c7e3f83a53c3",
      "name": "Delay Typing",
      "type": "n8n-nodes-base.wait",
      "position": [
        1200,
        -16
      ],
      "parameters": {
        "amount": "={{ Math.random()*5+3 }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "5870f259-616b-4031-8e5b-8982e88c30ae",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        464,
        112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d9b583e0-9c10-483b-88d8-25cd9a4b5f9d",
              "name": "body.monitor_name",
              "type": "string",
              "value": "={{ $json.body.monitor_name }}"
            },
            {
              "id": "4929fa58-9be3-44c4-b7f1-f82619a4f285",
              "name": "body.monitor_target",
              "type": "string",
              "value": "={{ $json.body.monitor_target }}"
            },
            {
              "id": "d2c5923f-af3b-4251-8ba2-dc612ffbde2d",
              "name": "body.monitor_type",
              "type": "string",
              "value": "={{ $json.body.monitor_type }}"
            },
            {
              "id": "a9172609-78bc-479b-9fa1-a578d3855411",
              "name": "body.monitor_status",
              "type": "string",
              "value": "={{ $json.body.monitor_status }}"
            },
            {
              "id": "f39f8c8e-2955-4bb5-8f6c-0a0f3045f6a7",
              "name": "teks",
              "type": "string",
              "value": "={{ $('Webhook').item.json.body.monitor_name }} is now {{ $json.body.monitor_status }}\nTarget : {{ $('Webhook').item.json.body.monitor_target }} \nType : {{ $('Webhook').item.json.body.monitor_type }} \nNoticed at : {{ new Date($('Webhook').item.json.body.timestamp * 1000).toLocaleString('en-GB', {\n     year: 'numeric',\n     month: '2-digit',\n     day: '2-digit',\n     hour: '2-digit',\n     minute: '2-digit',\n     second: '2-digit'\n}) }} (UTC+08:00)\n{{ !$('Webhook').item.json.body.down_minutes\n    ? ''\n    : 'Downtime : ' + $('Webhook').item.json.body.down_minutes + ' minutes' }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "54e8cc73-85e3-4cfb-9f12-c6cbb70e0fbb",
      "name": "Set Message Text",
      "type": "n8n-nodes-base.set",
      "position": [
        752,
        -16
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "15ea4bbc-679a-4a01-9252-ec57d2f5af0f",
              "name": "teks",
              "type": "string",
              "value": "={{ $json.teks }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e57649ec-8773-421f-8512-966019e5a6f6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -16
      ],
      "parameters": {
        "width": 432,
        "height": 352,
        "content": "## Webhook Call\n\n**http method :** POST\n\n**What needs to be prepared:**\n\n1. Create an account on the official HetrixTools website ([https://hetrixtools.com/register/](https://hetrixtools.com/register/))\n2. Create Uptime Monitors to monitor your server or network devices\n3. Create a default Contact and add the n8n webhook URL for integration\u201d\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d4bd8b96-834f-4c14-9288-b314918061d4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": "## If Node \nCheck if the notification type is device resource usage monitoring\n "
      },
      "typeVersion": 1
    },
    {
      "id": "1fa7cab0-8036-40a4-99e0-fcf38d17c1c2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -288
      ],
      "parameters": {
        "height": 320,
        "content": "## Edit Fields Node\nSet the text to be sent if the notification type is Server Resource Usage"
      },
      "typeVersion": 1
    },
    {
      "id": "1c1df31f-053b-4edf-929d-8c7a2e996e2f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        96
      ],
      "parameters": {
        "height": 336,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Edit Fields Node\nSet the text to be sent if the notification type is Uptime Monitoring"
      },
      "typeVersion": 1
    },
    {
      "id": "8c007dbd-e23b-4ca2-ae29-48db7571295d",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        -160
      ],
      "parameters": {
        "height": 336,
        "content": "## Set Message Text Node\nSet the text to be sent to the WhatsApp number"
      },
      "typeVersion": 1
    },
    {
      "id": "13fd8c5e-3e42-4c60-88a2-452f5fc358c4",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        -160
      ],
      "parameters": {
        "width": 880,
        "height": 336,
        "content": "## Sender Message Nodes \nSend the predefined text message via WhatsApp using GOWA \u2013 WhatsApp REST API"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "afba8f5e-3717-4197-ac1c-50bfd88095f8",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "If Server Resource Usage Monitoring",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Set Message Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delay Typing": {
      "main": [
        [
          {
            "node": "Stop Typing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Set Message Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stop Typing1": {
      "main": [
        [
          {
            "node": "Send Message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Message Text": {
      "main": [
        [
          {
            "node": "Send chat presence typing indicator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Server Resource Usage Monitoring": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send chat presence typing indicator": {
      "main": [
        [
          {
            "node": "Delay Typing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}