{ "kind": "open-flow-workflow", "version": 1, "name": "Monitor Sheet Servers and Email Alerts", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_e131587621e6a650": { "name": "Every minute", "kind": "cron", "cronTimes": [ { "type": "cron", "expression": "* * * * *", "timezone": "UTC" } ] }, "n_93278ff6064ad7b7": { "inputs": { "spreadsheetId": { "kind": "value", "value": "YOUR_SPREADSHEET_ID" }, "range": { "kind": "value", "value": "'Server_List'!A:Z" }, "majorDimension": { "kind": "value", "value": "ROWS" }, "valueRenderOption": { "kind": "value", "value": "UNFORMATTED_VALUE" } }, "name": "Read the server list", "kind": "task", "task": { "inputs": [ { "description": "The spreadsheet ID.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The spreadsheet ID." }, "nullable": true, "handle": "spreadsheetId", "value": null }, { "description": "The A1 notation of the range to retrieve.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The A1 notation of the range to retrieve." }, "nullable": false, "handle": "range" }, { "description": "The major dimension for the returned values.", "jsonSchema": { "type": "string", "enum": [ "DIMENSION_UNSPECIFIED", "ROWS", "COLUMNS" ], "description": "The major dimension for the returned values." }, "nullable": true, "handle": "majorDimension", "value": null }, { "description": "How values should be rendered in the output.", "jsonSchema": { "type": "string", "enum": [ "FORMATTED_VALUE", "UNFORMATTED_VALUE", "FORMULA" ], "description": "How values should be rendered in the output." }, "nullable": true, "handle": "valueRenderOption", "value": null }, { "description": "How dates and times should be rendered in the output.", "jsonSchema": { "type": "string", "enum": [ "SERIAL_NUMBER", "FORMATTED_STRING" ], "description": "How dates and times should be rendered in the output." }, "nullable": true, "handle": "dateTimeRenderOption", "value": null } ], "outputs": [ { "description": "The A1 notation of the range.", "jsonSchema": { "type": "string", "description": "The A1 notation of the range." }, "nullable": false, "handle": "range" }, { "description": "The major dimension of the values (ROWS or COLUMNS).", "jsonSchema": { "type": "string", "description": "The major dimension of the values (ROWS or COLUMNS)." }, "nullable": false, "handle": "majorDimension" }, { "description": "The data values in the range.", "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data values in the range." }, "nullable": false, "handle": "values" } ], "name": "Read the server list", "executor": { "kind": "connector", "action": "googlesheets.values_get" } } }, "n_5f3de78b7d76b2d5": { "inputs": { "values": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_93278ff6064ad7b7", "output": "values" } ] }, "previousState": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5f3de78b7d76b2d5", "output": "state" } ] } }, "name": "Prepare the next server", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data values in the range." }, "nullable": false, "handle": "values" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": true, "handle": "previousState" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "more" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "server" }, { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "count" } ], "name": "Prepare the next server", "moduleId": "n_0c2bda3738594591", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_1846e3ec3ddeedfd": { "inputs": {}, "name": "More servers to check?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "check", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_5f3de78b7d76b2d5", "output": "more" } }, "operator": "isTrue" } ] } ] } ] }, "n_d8bca861c26d02f5": { "inputs": { "initialUrl": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5f3de78b7d76b2d5", "output": "url" } ] }, "index": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5f3de78b7d76b2d5", "output": "count" } ] }, "previousState": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_dd8778e111e2e3f7", "output": "state" } ] } }, "name": "Prepare the HTTP target", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "initialUrl" }, { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "index" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": true, "handle": "previousState" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" } ], "name": "Prepare the HTTP target", "moduleId": "n_efd0c12465c91996", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_96c07942c4534459": { "inputs": { "url": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d8bca861c26d02f5", "output": "url" } ] } }, "name": "Check the server", "onError": "error", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Check the server", "executor": { "method": "GET", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "none", "authentication": { "type": "none" }, "responseFormat": "text", "statusPolicy": "all", "kind": "http-request" } } }, "n_f522409bab73fc34": { "inputs": {}, "name": "Did the check succeed?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "alive", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_96c07942c4534459", "output": "error", "system": true } }, "operator": "isNull" } ] } ] } ] }, "n_dd8778e111e2e3f7": { "inputs": { "url": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d8bca861c26d02f5", "output": "url" } ] }, "index": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5f3de78b7d76b2d5", "output": "count" } ] }, "status": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_96c07942c4534459", "output": "statusCode" } ] }, "headers": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_96c07942c4534459", "output": "headers" } ] }, "previousState": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_dd8778e111e2e3f7", "output": "state" } ] } }, "name": "Evaluate the response", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "index" }, { "jsonSchema": { "type": "integer" }, "nullable": true, "handle": "status" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": true, "handle": "headers" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": true, "handle": "previousState" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "redirect" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "alive" } ], "name": "Evaluate the response", "moduleId": "n_2f8749b64ac2096c", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_f7b609de05620b6c": { "inputs": {}, "name": "Follow a redirect?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "follow", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_dd8778e111e2e3f7", "output": "redirect" } }, "operator": "isTrue" } ] } ] } ] }, "n_ded1fc8882bd566c": { "inputs": {}, "name": "Is the server alive?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "alive", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_dd8778e111e2e3f7", "output": "alive" } }, "operator": "isTrue" } ] } ] } ] }, "n_0bb6bb6f26f4d45d": { "inputs": { "server": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5f3de78b7d76b2d5", "output": "server" } ] }, "status": { "kind": "value", "value": "Alive" } }, "name": "Prepare the alive log", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "server" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "status" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data to append." }, "nullable": false, "handle": "values" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "subject" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "message" } ], "name": "Prepare the alive log", "moduleId": "n_99b848e7054f141a", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_9d4e3b7a6f4485d7": { "inputs": { "server": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5f3de78b7d76b2d5", "output": "server" } ] }, "status": { "kind": "value", "value": "Down" } }, "name": "Prepare the down alert", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "server" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "status" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data to append." }, "nullable": false, "handle": "values" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "subject" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "message" } ], "name": "Prepare the down alert", "moduleId": "n_ce3e40b53b641f1f", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_6e8ca9464896b299": { "inputs": { "spreadsheetId": { "kind": "value", "value": "YOUR_SPREADSHEET_ID" }, "range": { "kind": "value", "value": "'Server_Status_Alive'!A:C" }, "values": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_0bb6bb6f26f4d45d", "output": "values" } ] }, "valueInputOption": { "kind": "value", "value": "RAW" }, "insertDataOption": { "kind": "value", "value": "INSERT_ROWS" } }, "name": "Log the alive server", "kind": "task", "task": { "inputs": [ { "description": "The spreadsheet ID.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The spreadsheet ID." }, "nullable": true, "handle": "spreadsheetId", "value": null }, { "description": "The A1 notation of the range to append values after.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The A1 notation of the range to append values after." }, "nullable": false, "handle": "range" }, { "description": "The data to append.", "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data to append." }, "nullable": false, "handle": "values" }, { "description": "The major dimension of the values array.", "jsonSchema": { "type": "string", "enum": [ "ROWS", "COLUMNS" ], "description": "The major dimension of the values array." }, "nullable": true, "handle": "majorDimension", "value": null }, { "description": "How the data should be inserted.", "jsonSchema": { "type": "string", "enum": [ "OVERWRITE", "INSERT_ROWS" ], "description": "How the data should be inserted." }, "nullable": true, "handle": "insertDataOption", "value": null }, { "description": "How the input data should be interpreted.", "jsonSchema": { "type": "string", "enum": [ "RAW", "USER_ENTERED" ], "description": "How the input data should be interpreted." }, "nullable": true, "handle": "valueInputOption", "value": null }, { "description": "Whether to include the appended values in the response.", "jsonSchema": { "type": "boolean", "description": "Whether to include the appended values in the response." }, "nullable": true, "handle": "includeValuesInResponse", "value": null }, { "description": "How values in the response should be rendered.", "jsonSchema": { "type": "string", "enum": [ "FORMATTED_VALUE", "UNFORMATTED_VALUE", "FORMULA" ], "description": "How values in the response should be rendered." }, "nullable": true, "handle": "responseValueRenderOption", "value": null }, { "description": "How dates in the response should be rendered.", "jsonSchema": { "type": "string", "enum": [ "SERIAL_NUMBER", "FORMATTED_STRING" ], "description": "How dates in the response should be rendered." }, "nullable": true, "handle": "responseDateTimeRenderOption", "value": null } ], "outputs": [ { "description": "The unique ID of the spreadsheet.", "jsonSchema": { "type": "string", "description": "The unique ID of the spreadsheet." }, "nullable": false, "handle": "spreadsheetId" }, { "description": "The A1 notation of the range that was updated.", "jsonSchema": { "type": "string", "description": "The A1 notation of the range that was updated." }, "nullable": false, "handle": "updatedRange" }, { "description": "The number of rows that were updated.", "jsonSchema": { "type": "integer", "description": "The number of rows that were updated." }, "nullable": false, "handle": "updatedRows" }, { "description": "The number of columns that were updated.", "jsonSchema": { "type": "integer", "description": "The number of columns that were updated." }, "nullable": false, "handle": "updatedColumns" }, { "description": "The number of cells that were updated.", "jsonSchema": { "type": "integer", "description": "The number of cells that were updated." }, "nullable": false, "handle": "updatedCells" }, { "description": "The values of the cells after the update.", "jsonSchema": { "type": "object", "properties": { "range": { "type": "string", "description": "The A1 notation of the range." }, "majorDimension": { "type": "string", "description": "The major dimension of the values (ROWS or COLUMNS)." }, "values": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data values in the range." } }, "required": [ "range", "majorDimension", "values" ], "additionalProperties": false, "description": "The values of the cells after the update." }, "nullable": true, "handle": "updatedData" }, { "description": "The A1 notation of the table range that data was appended to.", "jsonSchema": { "type": "string", "description": "The A1 notation of the table range that data was appended to." }, "nullable": false, "handle": "tableRange" } ], "name": "Log the alive server", "executor": { "kind": "connector", "action": "googlesheets.spreadsheets_values_append" } } }, "n_3ee2f46c7c0b180b": { "inputs": { "to": { "kind": "value", "value": "YOUR_ALERT_EMAIL" }, "subject": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9d4e3b7a6f4485d7", "output": "subject" } ] }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_9d4e3b7a6f4485d7", "output": "message" } ] }, "isHtml": { "kind": "value", "value": false } }, "name": "Email the down alert", "kind": "task", "task": { "inputs": [ { "description": "Primary recipient email address.", "jsonSchema": { "type": "string", "description": "Primary recipient email address." }, "nullable": true, "handle": "to", "value": null }, { "description": "Additional To recipients.", "jsonSchema": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Additional To recipients." }, "nullable": true, "handle": "extraRecipients", "value": null }, { "description": "Cc recipients.", "jsonSchema": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "A union variant." } ], "description": "Cc recipients." }, "nullable": true, "handle": "cc", "value": null }, { "description": "Bcc recipients.", "jsonSchema": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "A union variant." } ], "description": "Bcc recipients." }, "nullable": true, "handle": "bcc", "value": null }, { "description": "Email subject line.", "jsonSchema": { "type": "string", "description": "Email subject line." }, "nullable": true, "handle": "subject", "value": null }, { "description": "Email body content.", "jsonSchema": { "type": "string", "description": "Email body content." }, "nullable": true, "handle": "body", "value": null }, { "description": "Set to true when the body content is already HTML.", "jsonSchema": { "type": "boolean", "description": "Set to true when the body content is already HTML." }, "nullable": true, "handle": "isHtml", "value": null }, { "description": "Attachments and CID inline images. Up to 25,000,000 decoded bytes in total and 35,000,000 MIME bytes.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "filename": { "type": "string", "description": "Attachment filename; omit for an unnamed attachment." }, "mimeType": { "type": "string", "description": "MIME type without parameters; defaults to application/octet-stream." }, "contentBase64": { "type": "string", "description": "Standard padded Base64 content. Empty string represents a zero-byte file. Supply this or fileUrl." }, "fileUrl": { "type": "string", "format": "uri", "description": "Public URL to download the attachment. Supply this or contentBase64." }, "contentId": { "type": "string", "minLength": 1, "description": "Bare Content-ID without cid: or angle brackets; reference it as cid: in HTML." }, "disposition": { "type": "string", "enum": [ "inline", "attachment" ], "description": "Defaults to inline when contentId is set, otherwise attachment. Inline requires contentId." } }, "additionalProperties": false, "description": "An attachment or CID inline resource.", "oneOf": [ { "required": [ "contentBase64" ] }, { "required": [ "fileUrl" ] } ] }, "maxItems": 100, "description": "Attachments and CID inline images. Up to 25,000,000 decoded bytes in total and 35,000,000 MIME bytes." }, "nullable": true, "handle": "attachments", "value": null }, { "description": "Verified Gmail send-as alias to use in the From header.", "jsonSchema": { "type": "string", "description": "Verified Gmail send-as alias to use in the From header." }, "nullable": true, "handle": "fromEmail", "value": null } ], "outputs": [ { "description": "Gmail message ID.", "jsonSchema": { "type": "string", "description": "Gmail message ID." }, "nullable": false, "handle": "messageId" }, { "description": "Gmail thread ID.", "jsonSchema": { "type": "string", "description": "Gmail thread ID." }, "nullable": true, "handle": "threadId" } ], "name": "Email the down alert", "executor": { "kind": "connector", "action": "gmail.send_email" } } }, "n_1f22a2c234fbbcab": { "inputs": { "server": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5f3de78b7d76b2d5", "output": "server" } ] }, "status": { "kind": "value", "value": "Down" } }, "name": "Prepare the down log", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "server" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "status" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data to append." }, "nullable": false, "handle": "values" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "subject" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "message" } ], "name": "Prepare the down log", "moduleId": "n_0aeb1626c50ca05d", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_7e00b039f327412e": { "inputs": { "spreadsheetId": { "kind": "value", "value": "YOUR_SPREADSHEET_ID" }, "range": { "kind": "value", "value": "'Server_Status_Down'!A:C" }, "values": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_1f22a2c234fbbcab", "output": "values" } ] }, "valueInputOption": { "kind": "value", "value": "RAW" }, "insertDataOption": { "kind": "value", "value": "INSERT_ROWS" } }, "name": "Log the down server", "kind": "task", "task": { "inputs": [ { "description": "The spreadsheet ID.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The spreadsheet ID." }, "nullable": true, "handle": "spreadsheetId", "value": null }, { "description": "The A1 notation of the range to append values after.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The A1 notation of the range to append values after." }, "nullable": false, "handle": "range" }, { "description": "The data to append.", "jsonSchema": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data to append." }, "nullable": false, "handle": "values" }, { "description": "The major dimension of the values array.", "jsonSchema": { "type": "string", "enum": [ "ROWS", "COLUMNS" ], "description": "The major dimension of the values array." }, "nullable": true, "handle": "majorDimension", "value": null }, { "description": "How the data should be inserted.", "jsonSchema": { "type": "string", "enum": [ "OVERWRITE", "INSERT_ROWS" ], "description": "How the data should be inserted." }, "nullable": true, "handle": "insertDataOption", "value": null }, { "description": "How the input data should be interpreted.", "jsonSchema": { "type": "string", "enum": [ "RAW", "USER_ENTERED" ], "description": "How the input data should be interpreted." }, "nullable": true, "handle": "valueInputOption", "value": null }, { "description": "Whether to include the appended values in the response.", "jsonSchema": { "type": "boolean", "description": "Whether to include the appended values in the response." }, "nullable": true, "handle": "includeValuesInResponse", "value": null }, { "description": "How values in the response should be rendered.", "jsonSchema": { "type": "string", "enum": [ "FORMATTED_VALUE", "UNFORMATTED_VALUE", "FORMULA" ], "description": "How values in the response should be rendered." }, "nullable": true, "handle": "responseValueRenderOption", "value": null }, { "description": "How dates in the response should be rendered.", "jsonSchema": { "type": "string", "enum": [ "SERIAL_NUMBER", "FORMATTED_STRING" ], "description": "How dates in the response should be rendered." }, "nullable": true, "handle": "responseDateTimeRenderOption", "value": null } ], "outputs": [ { "description": "The unique ID of the spreadsheet.", "jsonSchema": { "type": "string", "description": "The unique ID of the spreadsheet." }, "nullable": false, "handle": "spreadsheetId" }, { "description": "The A1 notation of the range that was updated.", "jsonSchema": { "type": "string", "description": "The A1 notation of the range that was updated." }, "nullable": false, "handle": "updatedRange" }, { "description": "The number of rows that were updated.", "jsonSchema": { "type": "integer", "description": "The number of rows that were updated." }, "nullable": false, "handle": "updatedRows" }, { "description": "The number of columns that were updated.", "jsonSchema": { "type": "integer", "description": "The number of columns that were updated." }, "nullable": false, "handle": "updatedColumns" }, { "description": "The number of cells that were updated.", "jsonSchema": { "type": "integer", "description": "The number of cells that were updated." }, "nullable": false, "handle": "updatedCells" }, { "description": "The values of the cells after the update.", "jsonSchema": { "type": "object", "properties": { "range": { "type": "string", "description": "The A1 notation of the range." }, "majorDimension": { "type": "string", "description": "The major dimension of the values (ROWS or COLUMNS)." }, "values": { "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "description": "A union variant." }, { "type": "number", "description": "A union variant." }, { "type": "boolean", "description": "A union variant." }, { "const": null, "description": "A union variant." } ], "description": "The cell value schema." }, "description": "An array item." }, "description": "The data values in the range." } }, "required": [ "range", "majorDimension", "values" ], "additionalProperties": false, "description": "The values of the cells after the update." }, "nullable": true, "handle": "updatedData" }, { "description": "The A1 notation of the table range that data was appended to.", "jsonSchema": { "type": "string", "description": "The A1 notation of the table range that data was appended to." }, "nullable": false, "handle": "tableRange" } ], "name": "Log the down server", "executor": { "kind": "connector", "action": "googlesheets.spreadsheets_values_append" } } }, "n_cca3b8e7ad861ad3": { "name": "Checked server count", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "count" } ], "outputMappings": { "count": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5f3de78b7d76b2d5", "output": "count" } ] } } } }, "edges": [ { "source": "n_e131587621e6a650", "target": "n_93278ff6064ad7b7" }, { "source": "n_93278ff6064ad7b7", "target": "n_5f3de78b7d76b2d5" }, { "source": "n_5f3de78b7d76b2d5", "target": "n_1846e3ec3ddeedfd" }, { "source": "n_1846e3ec3ddeedfd", "target": "n_d8bca861c26d02f5", "sourceHandle": "check" }, { "source": "n_d8bca861c26d02f5", "target": "n_96c07942c4534459" }, { "source": "n_96c07942c4534459", "target": "n_f522409bab73fc34" }, { "source": "n_f522409bab73fc34", "target": "n_dd8778e111e2e3f7", "sourceHandle": "alive" }, { "source": "n_f522409bab73fc34", "target": "n_9d4e3b7a6f4485d7", "sourceHandle": "otherwise" }, { "source": "n_dd8778e111e2e3f7", "target": "n_f7b609de05620b6c" }, { "source": "n_f7b609de05620b6c", "target": "n_d8bca861c26d02f5", "sourceHandle": "follow" }, { "source": "n_f7b609de05620b6c", "target": "n_ded1fc8882bd566c", "sourceHandle": "otherwise" }, { "source": "n_ded1fc8882bd566c", "target": "n_0bb6bb6f26f4d45d", "sourceHandle": "alive" }, { "source": "n_ded1fc8882bd566c", "target": "n_9d4e3b7a6f4485d7", "sourceHandle": "otherwise" }, { "source": "n_0bb6bb6f26f4d45d", "target": "n_6e8ca9464896b299" }, { "source": "n_9d4e3b7a6f4485d7", "target": "n_3ee2f46c7c0b180b" }, { "source": "n_6e8ca9464896b299", "target": "n_5f3de78b7d76b2d5" }, { "source": "n_3ee2f46c7c0b180b", "target": "n_1f22a2c234fbbcab" }, { "source": "n_1f22a2c234fbbcab", "target": "n_7e00b039f327412e" }, { "source": "n_7e00b039f327412e", "target": "n_5f3de78b7d76b2d5" }, { "source": "n_1846e3ec3ddeedfd", "target": "n_cca3b8e7ad861ad3", "sourceHandle": "otherwise" } ] } }, "modules": { "n_0c2bda3738594591": { "name": "Prepare the next server", "imports": [], "source": "export default function nextServer({values,previousState}) {\n if(!Array.isArray(values))throw Error('Invalid server sheet');\n const idx=previousState?.index??0;if(!Number.isInteger(idx)||idx<0)throw Error('Invalid monitor state');\n if(values.length===0)return {state:{index:0},more:false,url:'http://unused.invalid',server:'',count:0};\n const header=values[0];if(!Array.isArray(header)||header.filter(v=>v==='Server').length!==1)throw Error('Server_List needs one Server header');const column=header.indexOf('Server');\n const rows=values.slice(1).filter(r=>Array.isArray(r)&&r.some(v=>v!==''&&v!==null));if(idx>=rows.length)return {state:{index:idx},more:false,url:'http://unused.invalid',server:'',count:idx};\n const server=rows[idx][column];if(typeof server!=='string'||!server.trim()||/[\\r\\n]/.test(server))throw Error('Every server row needs a server address');return{state:{index:idx+1},more:true,url:'http://'+server,server,count:idx+1};\n}\n" }, "n_efd0c12465c91996": { "name": "Prepare the HTTP target", "imports": [], "source": "export default function serverHop({initialUrl,index,previousState}) {\n return {url:previousState?.index===index&&previousState?.nextUrl?previousState.nextUrl:initialUrl};\n}\n" }, "n_2f8749b64ac2096c": { "name": "Evaluate the response", "imports": [], "source": "export default function assessServer({url,index,status,headers,previousState}) {\n const prior=previousState?.index===index?previousState.hops:0;if(!Number.isInteger(prior)||prior<0)throw Error('Invalid redirect state');\n if((status>=300&&status<400)&&typeof headers?.location==='string'&&headers.location){\n if(prior>=21)return {state:{index,hops:prior,nextUrl:''},redirect:false,alive:false};\n try{const target=new URL(headers.location,url);if(!['http:','https:'].includes(target.protocol)||target.username||target.password)throw Error();return{state:{index,hops:prior+1,nextUrl:target.toString()},redirect:true,alive:false};}catch{return {state:{index,hops:prior,nextUrl:''},redirect:false,alive:false};}\n }\n return {state:{index,hops:prior,nextUrl:''},redirect:false,alive:status>=200&&status<300};\n}\n" }, "n_99b848e7054f141a": { "name": "Prepare the alive log", "imports": [], "source": "export default function serverFields({server,status}) {\n if(typeof server!=='string'||!server||!['Alive','Down'].includes(status))throw Error('Invalid server or status');\n const now=new Date().toISOString(),day=now.slice(0,10),stamp=now.slice(0,19).replace('T',' ');\n return {values:[[server,status==='Alive'?day:stamp,status]],subject:'šŸ”» Server Down: '+server+': '+day,message:'Hi Team,\\n\\nAt '+stamp+', the following server failed its HTTP check:\\n\\nšŸ”» Server Down: '+server+'\\n\\nPlease investigate immediately to prevent service disruption.\\n\\nAutomated Monitoring System\\n'};\n}\n" }, "n_ce3e40b53b641f1f": { "name": "Prepare the down alert", "imports": [], "source": "export default function serverFields({server,status}) {\n if(typeof server!=='string'||!server||!['Alive','Down'].includes(status))throw Error('Invalid server or status');\n const now=new Date().toISOString(),day=now.slice(0,10),stamp=now.slice(0,19).replace('T',' ');\n return {values:[[server,status==='Alive'?day:stamp,status]],subject:'šŸ”» Server Down: '+server+': '+day,message:'Hi Team,\\n\\nAt '+stamp+', the following server failed its HTTP check:\\n\\nšŸ”» Server Down: '+server+'\\n\\nPlease investigate immediately to prevent service disruption.\\n\\nAutomated Monitoring System\\n'};\n}\n" }, "n_0aeb1626c50ca05d": { "name": "Prepare the down log", "imports": [], "source": "export default function serverFields({server,status}) {\n if(typeof server!=='string'||!server||!['Alive','Down'].includes(status))throw Error('Invalid server or status');\n const now=new Date().toISOString(),day=now.slice(0,10),stamp=now.slice(0,19).replace('T',' ');\n return {values:[[server,status==='Alive'?day:stamp,status]],subject:'šŸ”» Server Down: '+server+': '+day,message:'Hi Team,\\n\\nAt '+stamp+', the following server failed its HTTP check:\\n\\nšŸ”» Server Down: '+server+'\\n\\nPlease investigate immediately to prevent service disruption.\\n\\nAutomated Monitoring System\\n'};\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }