{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "1e0a4c37-766c-4c94-8907-a75ea0a602df",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -176,
        64
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a8e96da1-0743-495b-956d-91756622f1f9",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        1744,
        528
      ],
      "parameters": {
        "text": "=pixcelsthemes.com is down",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": "U090AD0HPA6",
          "cachedResultName": "yunitmoradiya21"
        },
        "select": "user",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "e059f3c3-e79e-4f34-9b16-3d8f39cefd3a",
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1744,
        352
      ],
      "parameters": {
        "url": "https://api.vapi.ai/call",
        "method": "POST",
        "options": {},
        "jsonBody": "{\n  \"assistantId\": \"b208b330-51f2-47a7-b3b1-3d73f3ab09b5\",\n  \"phoneNumberId\": \"694f09bf-a35a-4749-960b-a4e82e916344\",\n  \"customer\": {\n  \"number\": \"+1234567890\"\n  }\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "7bf02b80-d3fc-4ef8-b6e8-c17133be33b7",
      "name": "Send a message1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1744,
        192
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "picxelsthemes.com is down!!!!!!",
        "options": {},
        "subject": "website"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "99cd6788-9c02-4690-9277-a736ac81201d",
      "name": "htttps request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        512,
        80
      ],
      "parameters": {
        "url": "https://www.pixcelsthemes.com/",
        "options": {
          "timeout": 5000,
          "response": {
            "response": {
              "fullResponse": true
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "429df677-0fc0-47c9-8954-c47f32edc24b",
      "name": "If website up?",
      "type": "n8n-nodes-base.if",
      "position": [
        880,
        -96
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c9e1e7cd-16e7-4c2f-9574-adb8ad0872d5",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $json.statusCode }}",
              "rightValue": 200
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9026b8a2-be7d-4763-adc4-e9ea37507748",
      "name": "Append row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1952,
        -128
      ],
      "parameters": {
        "columns": {
          "value": {
            "date": "={{ $now }}",
            "status": "={{ $json.status }}",
            "website url": "={{ $('Get row(s) in sheet').item.json.urls }}"
          },
          "schema": [
            {
              "id": "website url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "website url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1IV5g3WQMLCY3NgqAd7gMqswLNBfPyfdICGN-x0nce-g/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1IV5g3WQMLCY3NgqAd7gMqswLNBfPyfdICGN-x0nce-g",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1IV5g3WQMLCY3NgqAd7gMqswLNBfPyfdICGN-x0nce-g/edit?usp=drivesdk",
          "cachedResultName": "uptime log"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "5692e27a-7db9-4921-9a4f-2554376e8d7b",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1712,
        -128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b4c10ba0-41c3-48e8-86c7-a09901cfa558",
              "name": "status",
              "type": "string",
              "value": "up"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e7498a0f-ae60-417c-bbfb-df351e8a22fc",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        32,
        64
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1a-ONc1vue5Bt2WuMz3EQKlhZ6tiSh09s8zeuzViAi70/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1a-ONc1vue5Bt2WuMz3EQKlhZ6tiSh09s8zeuzViAi70",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1a-ONc1vue5Bt2WuMz3EQKlhZ6tiSh09s8zeuzViAi70/edit?usp=drivesdk",
          "cachedResultName": "uptime status"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "e7aa2689-9d70-4ced-b617-13442eb5df69",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        240,
        64
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "929a1491-d40d-42d8-838b-26ac83ca3eee",
      "name": "Append row in sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1744,
        688
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "website url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "website url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1IV5g3WQMLCY3NgqAd7gMqswLNBfPyfdICGN-x0nce-g",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1IV5g3WQMLCY3NgqAd7gMqswLNBfPyfdICGN-x0nce-g/edit?usp=drivesdk",
          "cachedResultName": "uptime log"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "31e8a7d2-cf7d-41d3-9d50-1753c13c276e",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        1488,
        688
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e59a32c9-9593-4236-97be-e1220479f253",
              "name": "status",
              "type": "string",
              "value": "down"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2b5ebc5f-0d5d-4803-9d88-c3a0b17854ee",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        -32
      ],
      "parameters": {
        "width": 640,
        "height": 736,
        "content": "## Website Uptime Monitor with Multi-Channel Alerts\n\n### How it works\n1. The workflow starts on a schedule, retrieving a list of website URLs from a Google Sheet.\n2. For each URL, it performs an HTTP request to check the website's availability.\n3. Based on the HTTP response status, the workflow determines if the website is \\\"up\\\" or \\\"down\\\" and logs this status, along with the date, into a separate \\\"uptime log\\\" Google Sheet.\n4. If a website is found to be down, the workflow triggers immediate alerts, sending notifications via Slack, Gmail, and initiating an automated phone call using Vapi.ai.\n### Setup\n- [ ] Connect Google Sheets accounts for both the website list and the uptime log.\n- [ ] Configure the 'Get row(s) in sheet' node to select your Google Sheet containing website URLs.\n- [ ] Configure the 'Append row in sheet' nodes to select your Google Sheet for logging uptime status.\n- [ ] Ensure the 'htttps request' node uses the website URL from the Google Sheet for checking.\n- [ ] Connect your Slack account and specify the channel or user for downtime alerts.\n- [ ] Connect your Gmail account and set the recipient email for downtime alerts.\n- [ ] Add your Vapi.ai API Key and configure the phone number to be called during downtime.\n- [ ] Set the desired schedule for the uptime checks in the 'Schedule Trigger' node."
      },
      "typeVersion": 1
    },
    {
      "id": "bd074c74-d21b-4d0a-9c9f-f28980f8c2a4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -48
      ],
      "parameters": {
        "color": 7,
        "width": 384,
        "height": 272,
        "content": "## 1. get data from google sheet"
      },
      "typeVersion": 1
    },
    {
      "id": "2354eefc-a962-4e88-a3a0-e2ce7f736d5c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        -32
      ],
      "parameters": {
        "color": 7,
        "width": 448,
        "height": 272,
        "content": "## 2. loop over urls to check status\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "bf8f114e-5d3e-4e66-9a5a-d925ab8e2c6e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        -224
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 256,
        "content": "## 3. log the status to ggogle sheet if up"
      },
      "typeVersion": 1
    },
    {
      "id": "2985eac9-973b-44c6-a917-2e85c7a27f87",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1424,
        96
      ],
      "parameters": {
        "color": 7,
        "width": 720,
        "height": 752,
        "content": "## 4. inform user via slack, mail and call, and log the status to sheets"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Append row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If website up?": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send a message1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "htttps request": {
      "main": [
        [
          {
            "node": "If website up?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "htttps request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}