{
  "id": "C2H30nZSobkGC5ni",
  "meta": {
    "templateId": "5887",
    "templateCredsSetupCompleted": true
  },
  "name": "Website Down Checker Robot",
  "tags": [
    {
      "id": "TX1jqCYYJtunXrN6",
      "name": "Muntasir Mubin",
      "createdAt": "2025-12-11T12:28:51.171Z",
      "updatedAt": "2025-12-11T12:28:51.171Z"
    }
  ],
  "nodes": [
    {
      "id": "37640544-a4cf-44fb-bdec-1b33b773b8ab",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        368,
        240
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "916ea745-93d3-4df0-bb42-92dbdc9096e2",
      "name": "Calculate Status",
      "type": "n8n-nodes-base.set",
      "position": [
        1600,
        208
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b0cbcff5-bfcf-46a5-a386-65c4dd56c42f",
              "name": "date",
              "type": "string",
              "value": "={{ $json.headers.date }}"
            },
            {
              "id": "8c4155e4-bcc6-41dd-9582-346a57a7b997",
              "name": "website",
              "type": "string",
              "value": "={{ $('Split Out').item.json.Websites }}"
            },
            {
              "id": "9af72278-5b29-406a-b4c5-f47f3d805063",
              "name": "IS_UP",
              "type": "boolean",
              "value": "={{ $json.statusCode <= 400  }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "5d27ce2f-f7fd-41d1-b8b6-ffd3f006ae9f",
      "name": "Perform Site Test",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        1104,
        256
      ],
      "parameters": {
        "url": "={{ $json.Websites }}",
        "options": {
          "batching": {
            "batch": {}
          },
          "response": {
            "response": {
              "neverError": true,
              "fullResponse": true
            }
          }
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3591075f-9475-498a-a4ea-e4231feaa1ce",
      "name": "Status Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        1840,
        240
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "UP",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7191e7cb-f2e1-4288-aa68-21f6efefafc5",
                    "operator": {
                      "type": "boolean",
                      "operation": "true",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.IS_UP }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "DOWN",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "e07edddc-70be-46ed-9f5c-7fba0ed52bc3",
                    "operator": {
                      "type": "boolean",
                      "operation": "false",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.IS_UP }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "b05da316-3fc1-4322-bd9d-be780e348256",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        880,
        368
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "Websites"
      },
      "typeVersion": 1
    },
    {
      "id": "071ec250-71c8-4091-9f82-7f987f582d77",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "position": [
        576,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "72b729c6-e0af-46f0-955f-c649e9d397bc",
              "name": "Websites",
              "type": "string",
              "value": "=https://google.com\nhttps://bad.url\nhttps://webdextro.org"
            },
            {
              "id": "25457f32-6440-404d-8e99-eb772e552982",
              "name": "wait_secs",
              "type": "number",
              "value": 5
            },
            {
              "id": "4f646a6a-3f84-4410-bed2-3b0d770066c7",
              "name": "telegram_chat_id",
              "type": "string",
              "value": "chat Id here!"
            },
            {
              "id": "5ea1be97-40ce-4696-9454-ecb17127e674",
              "name": "alert_email",
              "type": "string",
              "value": "you@example.com"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "fd4c06eb-e851-4759-869d-9b35429e42c0",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        816,
        128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ce076f11-d745-43a9-8069-a55759ceb0c9",
              "name": "Websites",
              "type": "array",
              "value": "={{\n  // we split by line, and only keep non-empty lines\n  $json.Websites.split('\\n').filter((url) => url)\n}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1437a14a-cbac-487a-8a89-edc37496348d",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1392,
        208
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "8af693e1-b9d9-4bb9-8276-72760ab9133e",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        2128,
        288
      ],
      "parameters": {
        "amount": "={{ $('Config').item.json.wait_secs }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "60e797ef-cb3e-41e5-833b-f1f167735416",
      "name": "Calculate Status1",
      "type": "n8n-nodes-base.set",
      "position": [
        1760,
        512
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b0cbcff5-bfcf-46a5-a386-65c4dd56c42f",
              "name": "date",
              "type": "string",
              "value": "={{ $json.headers.date }}"
            },
            {
              "id": "8c4155e4-bcc6-41dd-9582-346a57a7b997",
              "name": "website",
              "type": "string",
              "value": "={{ $('Split Out').item.json.Websites }}"
            },
            {
              "id": "9af72278-5b29-406a-b4c5-f47f3d805063",
              "name": "IS_UP",
              "type": "boolean",
              "value": "={{ $json.statusCode <= 400  }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "60de7380-2539-4885-b2c3-8bdd25d92fd3",
      "name": "Perform Site Test1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        1280,
        512
      ],
      "parameters": {
        "url": "={{ $json.Websites }}",
        "options": {
          "batching": {
            "batch": {}
          },
          "response": {
            "response": {
              "neverError": true,
              "fullResponse": true
            }
          }
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a3578c1f-59b1-441a-b546-ee56126522e3",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        1536,
        512
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "b9376336-dde1-4aa0-a9df-d8a50a257de1",
      "name": "Status Router1",
      "type": "n8n-nodes-base.switch",
      "position": [
        1984,
        512
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "UP",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7191e7cb-f2e1-4288-aa68-21f6efefafc5",
                    "operator": {
                      "type": "boolean",
                      "operation": "true",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.IS_UP }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "DOWN",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "e07edddc-70be-46ed-9f5c-7fba0ed52bc3",
                    "operator": {
                      "type": "boolean",
                      "operation": "false",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.IS_UP }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "47a68788-0158-4488-8f0f-305b52ca64e2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        784
      ],
      "parameters": {
        "width": 328,
        "height": 356,
        "content": ".\n.\n.\n.\n.\n.\n.\n\n## Add Email credentials (SMTP) here.\n    Port: 465\n### for Gmail Server: mail.google.com"
      },
      "typeVersion": 1
    },
    {
      "id": "872f9a1b-95b9-4d1e-aac5-35f9314942d1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        144
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 352,
        "content": "##  Add your websites here\n.\n.\n.\n.\n.\n.\n.\n.\n.\n### Also add your Telegram Chat ID and Mail Address here"
      },
      "typeVersion": 1
    },
    {
      "id": "2a8bcb6d-9692-4206-92ed-a70bd4fd8dc2",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1552,
        800
      ],
      "parameters": {
        "text": "={{ $('Calculate Status').item.json.website }} is DOWN.\nFrom: n8n uptime",
        "chatId": "={{ $('Config').item.json.telegram_chat_id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3a5369af-1538-4191-b463-4dcc674dc876",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        576
      ],
      "parameters": {
        "width": 760,
        "height": 524,
        "content": "# Instructions; Telegram bot\n\n1. **Create your Telegram bot**  \n   1. Open Telegram and chat with **@BotFather**.  \n   2. Send `/newbot` and follow prompts to pick a bot **name** and **username** (must end in \u201cbot\u201d).  \n   3. Copy the **bot token** returned by BotFather.\n\n2. **Start a conversation & get the chat ID**  \n   1. In Telegram, find your bot by username (e.g. `@my_alert_bot`) and send it a message (e.g. `/start`).  \n   2. In your browser, visit:  \n      ```\n      https://api.telegram.org/bot<Token>/getUpdates\n      ```  \n   3. Locate `\"chat\":{\"id\":123456789}` in the JSON and copy that number as your **chat_id**.\n\n3. **Add Telegram settings in n8n**  \n   - In your workflow, click on the **Telegram** node.  \n   - Under **Credentials**, select **Create New** \u2192 **Telegram Bot API**, and paste your **bot token**.  \n   - In the **Config node\u2019s** **telegram_chat_id** field, enter the numeric **chat_id** you retrieved.\n\nThat\u2019s it! Your n8n workflow now sends notifications via both Gmail and Telegram.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "46ae7a40-6352-401c-9919-cc211d79fb50",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1760,
        784
      ],
      "parameters": {
        "color": 5,
        "width": 456,
        "height": 312,
        "content": "## Made by:\n # Muntasir Mubin\n### The Founder & CEO of WebDextro Ltd, a distinguished Web & App development company based in the United Kingdom.\n\n\ud83d\udce7 mubin@webdextro.org\n\ud83d\udcde [Follow on Facebook](https://fb.me/the.mubiin)\n\ud83d\udcbc [Add me on Linkedin](https://www.linkedin.com/in/mubiiin/)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e515675c-be99-456d-a384-038cd815b379",
      "name": "Send email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1344,
        800
      ],
      "parameters": {
        "html": "<!doctype html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n  <title>Website Down Notification</title>\n</head>\n<body style=\"margin:0;padding:0;background:#f2f4f6;font-family:Arial,Helvetica,sans-serif;\">\n  <!-- Container -->\n  <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"max-width:600px;margin:24px auto;background:#ffffff;border-radius:6px;overflow:hidden;box-shadow:0 2px 6px rgba(0,0,0,0.08);\">\n    <tr>\n      <td style=\"padding:18px 20px;background:#0b69ff;color:#ffffff;text-align:center;\">\n        <h1 style=\"margin:0;font-size:20px;\">Website Offline Alert</h1>\n      </td>\n    </tr>\n\n    <tr>\n      <td style=\"padding:20px;\">\n        <p style=\"margin:0 0 12px 0;color:#333333;font-size:15px;line-height:1.5;\">\n          Hello <strong>{{Recipient Name}}</strong>,\n        </p>\n\n        <p style=\"margin:0 0 12px 0;color:#333333;font-size:15px;line-height:1.5;\">\n          We wanted to let you know that <strong>{{YourWebsite.com}}</strong> is currently <strong>unavailable</strong>. Our team has been notified and is investigating the issue.\n        </p>\n\n        <table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:12px 0;\">\n          <tr>\n            <td style=\"padding:10px;background:#f7f9fc;border:1px solid #eef1f6;border-radius:6px;font-size:14px;color:#333;\">\n              <strong>Incident:</strong> Website unreachable<br>\n              <strong>Detected at:</strong> {{YYYY-MM-DD HH:MM}}<br>\n              <strong>Estimated fix:</strong> {{If known, e.g. ~30 minutes}} or \"Under investigation\"\n            </td>\n          </tr>\n        </table>\n\n        <p style=\"margin:12px 0;color:#333333;font-size:15px;line-height:1.5;\">\n          We apologize for the inconvenience. You can reply to this email or contact our support:\n        </p>\n\n        <p style=\"margin:0 0 18px 0;color:#333333;font-size:15px;line-height:1.5;\">\n          Phone: <a href=\"tel:+880XXXXXXXXXX\" style=\"color:#0b69ff;text-decoration:none;\">+880XXXXXXXXXX</a><br>\n          Email: <a href=\"mailto:user@example.com\" style=\"color:#0b69ff;text-decoration:none;\">user@example.com</a>\n        </p>\n\n        <div style=\"text-align:center;margin-bottom:8px;\">\n          <a href=\"{{status_page_url}}\" style=\"display:inline-block;padding:10px 18px;border-radius:6px;text-decoration:none;background:#0b69ff;color:#fff;font-weight:600;font-size:14px;\">\n            Check Status Page\n          </a>\n        </div>\n\n        <p style=\"margin:0;color:#777;font-size:13px;line-height:1.4;\">\n          Thank you,<br>\n          The <strong>{{YourCompanyName}}</strong> Team\n        </p>\n      </td>\n    </tr>\n\n    <tr>\n      <td style=\"padding:12px 20px;background:#fafbfc;color:#99a1ab;font-size:12px;text-align:center;\">\n        This is an automated message. Please do not reply to this address.\n      </td>\n    </tr>\n  </table>\n\n  <!-- Plain-text fallback (for clients that ignore HTML) -->\n  <div style=\"display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;\">\n    [ALERT] {{YourWebsite.com}} is currently unavailable. Detected at {{YYYY-MM-DD HH:MM}}. Contact: user@example.com\n  </div>\n</body>\n</html>\n",
        "options": {},
        "subject": "Website Down",
        "toEmail": "user@example.com",
        "fromEmail": "user@example.com"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c1fa188f-8769-46ea-8611-96cd08909cd8",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Perform Site Test1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Calculate Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Calculate Status1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Perform Site Test",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send email": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Status Router": {
      "main": [
        [],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Status Router1": {
      "main": [
        [],
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Status": {
      "main": [
        [
          {
            "node": "Status Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Status1": {
      "main": [
        [
          {
            "node": "Status Router1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Perform Site Test": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Perform Site Test1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}