478 lines
9.1 KiB
JSON
Executable File
478 lines
9.1 KiB
JSON
Executable File
{
|
||
"id": 18,
|
||
"name": "Alarms",
|
||
"active": true,
|
||
"nodes": [
|
||
{
|
||
"parameters": {},
|
||
"name": "Start",
|
||
"type": "n8n-nodes-base.start",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-160,
|
||
240
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"authentication": "headerAuth",
|
||
"url": "https://api.ukrainealarm.com/api/v3/alerts/1591",
|
||
"options": {}
|
||
},
|
||
"name": "HTTP Request1",
|
||
"type": "n8n-nodes-base.httpRequest",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-620,
|
||
540
|
||
],
|
||
"credentials": {
|
||
"httpHeaderAuth": {
|
||
"id": "22",
|
||
"name": "Header Auth account 2"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"triggerTimes": {
|
||
"item": [
|
||
{
|
||
"mode": "everyMinute"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"name": "Cron",
|
||
"type": "n8n-nodes-base.cron",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-820,
|
||
540
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"chatId": "56628475",
|
||
"text": "‼️ <b>Внимание!</b>\nВоздушная тревога",
|
||
"additionalFields": {
|
||
"parse_mode": "HTML"
|
||
}
|
||
},
|
||
"name": "Telegram",
|
||
"type": "n8n-nodes-base.telegram",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
740,
|
||
740
|
||
],
|
||
"credentials": {
|
||
"telegramApi": {
|
||
"id": "38",
|
||
"name": "home.cynic.club"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"chatId": "56628475",
|
||
"text": "✅ <b>Внимание!</b>\nОтбой воздушной тревоги",
|
||
"additionalFields": {
|
||
"parse_mode": "HTML"
|
||
}
|
||
},
|
||
"name": "Telegram1",
|
||
"type": "n8n-nodes-base.telegram",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
740,
|
||
320
|
||
],
|
||
"credentials": {
|
||
"telegramApi": {
|
||
"id": "38",
|
||
"name": "home.cynic.club"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"chatId": "1684481",
|
||
"text": "‼️ <b>Внимание!</b>\nВоздушная тревога",
|
||
"additionalFields": {
|
||
"parse_mode": "HTML"
|
||
}
|
||
},
|
||
"name": "Telegram2",
|
||
"type": "n8n-nodes-base.telegram",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
740,
|
||
960
|
||
],
|
||
"credentials": {
|
||
"telegramApi": {
|
||
"id": "38",
|
||
"name": "home.cynic.club"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"chatId": "1684481",
|
||
"text": "✅ <b>Внимание!</b>\nОтбой воздушной тревоги",
|
||
"additionalFields": {
|
||
"parse_mode": "HTML"
|
||
}
|
||
},
|
||
"name": "Telegram3",
|
||
"type": "n8n-nodes-base.telegram",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
740,
|
||
500
|
||
],
|
||
"credentials": {
|
||
"telegramApi": {
|
||
"id": "38",
|
||
"name": "home.cynic.club"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"keepOnlySet": true,
|
||
"values": {
|
||
"string": [
|
||
{
|
||
"name": "alert",
|
||
"value": "OFF"
|
||
}
|
||
]
|
||
},
|
||
"options": {}
|
||
},
|
||
"name": "Set",
|
||
"type": "n8n-nodes-base.set",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-180,
|
||
400
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"conditions": {
|
||
"string": [
|
||
{
|
||
"value1": "={{$json[\"0\"][\"activeAlerts\"]}}",
|
||
"operation": "isEmpty"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"name": "IF2",
|
||
"type": "n8n-nodes-base.if",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-400,
|
||
540
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"keepOnlySet": true,
|
||
"values": {
|
||
"string": [
|
||
{
|
||
"name": "alert",
|
||
"value": "ON"
|
||
}
|
||
]
|
||
},
|
||
"options": {}
|
||
},
|
||
"name": "Set1",
|
||
"type": "n8n-nodes-base.set",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-180,
|
||
780
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"operation": "update",
|
||
"docId": "r8eT1qvH8UU8vrxjuytXgj",
|
||
"tableId": "Alarm",
|
||
"rowId": "1",
|
||
"fieldsToSend": {
|
||
"properties": [
|
||
{
|
||
"fieldId": "activeAlerts",
|
||
"fieldValue": "={{$json[\"alert\"]}}"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"name": "Grist",
|
||
"type": "n8n-nodes-base.grist",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
320,
|
||
460
|
||
],
|
||
"credentials": {
|
||
"gristApi": {
|
||
"id": "21",
|
||
"name": "Grist account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"operation": "update",
|
||
"docId": "r8eT1qvH8UU8vrxjuytXgj",
|
||
"tableId": "Alarm",
|
||
"rowId": "1",
|
||
"fieldsToSend": {
|
||
"properties": [
|
||
{
|
||
"fieldId": "activeAlerts",
|
||
"fieldValue": "={{$json[\"alert\"]}}"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"name": "Grist1",
|
||
"type": "n8n-nodes-base.grist",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
320,
|
||
840
|
||
],
|
||
"credentials": {
|
||
"gristApi": {
|
||
"id": "21",
|
||
"name": "Grist account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"mode": "removeKeyMatches",
|
||
"propertyName1": "alert",
|
||
"propertyName2": "activeAlerts"
|
||
},
|
||
"name": "Merge",
|
||
"type": "n8n-nodes-base.merge",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
80,
|
||
460
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"docId": "r8eT1qvH8UU8vrxjuytXgj",
|
||
"tableId": "Alarm",
|
||
"additionalOptions": {}
|
||
},
|
||
"name": "Grist2",
|
||
"type": "n8n-nodes-base.grist",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-180,
|
||
560
|
||
],
|
||
"credentials": {
|
||
"gristApi": {
|
||
"id": "21",
|
||
"name": "Grist account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"mode": "removeKeyMatches",
|
||
"propertyName1": "alert",
|
||
"propertyName2": "activeAlerts"
|
||
},
|
||
"name": "Merge1",
|
||
"type": "n8n-nodes-base.merge",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
80,
|
||
840
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"docId": "r8eT1qvH8UU8vrxjuytXgj",
|
||
"tableId": "Alarm",
|
||
"additionalOptions": {}
|
||
},
|
||
"name": "Grist3",
|
||
"type": "n8n-nodes-base.grist",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-180,
|
||
940
|
||
],
|
||
"credentials": {
|
||
"gristApi": {
|
||
"id": "21",
|
||
"name": "Grist account"
|
||
}
|
||
}
|
||
}
|
||
],
|
||
"connections": {
|
||
"Cron": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "HTTP Request1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"HTTP Request1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "IF2",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Set": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Merge",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"IF2": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Set",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
],
|
||
[
|
||
{
|
||
"node": "Set1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Set1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Merge1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Grist1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Telegram",
|
||
"type": "main",
|
||
"index": 0
|
||
},
|
||
{
|
||
"node": "Telegram2",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Grist": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Telegram1",
|
||
"type": "main",
|
||
"index": 0
|
||
},
|
||
{
|
||
"node": "Telegram3",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Grist2": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Merge",
|
||
"type": "main",
|
||
"index": 1
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Merge": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Grist",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Merge1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Grist1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Grist3": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Merge1",
|
||
"type": "main",
|
||
"index": 1
|
||
}
|
||
]
|
||
]
|
||
}
|
||
},
|
||
"createdAt": "2022-05-05T11:59:53.012Z",
|
||
"updatedAt": "2022-07-15T05:57:23.180Z",
|
||
"settings": {
|
||
"errorWorkflow": "25",
|
||
"saveDataSuccessExecution": "all"
|
||
},
|
||
"staticData": null,
|
||
"tags": []
|
||
} |