Files
n8n/flows/58.json

1054 lines
25 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"id": 58,
"name": "avtomoto25 new date",
"active": true,
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
-1100,
1180
]
},
{
"parameters": {
"operation": "update",
"calendar": "hvttbe9pijtp5c3iqiaj1rfvps%40group.calendar.google.com",
"eventId": "31g2bcqsnqavh7e5deusa8b2oq\t",
"updateFields": {
"allday": "yes",
"end": "= {{$json[\"date\"][\"google\"]}} 23:00:00",
"start": "= {{$json[\"date\"][\"google\"]}} 01:00:00"
}
},
"name": "Google Calendar",
"type": "n8n-nodes-base.googleCalendar",
"typeVersion": 1,
"position": [
740,
1200
],
"credentials": {
"googleCalendarOAuth2Api": {
"id": "6",
"name": "Google Calendar account"
}
}
},
{
"parameters": {
"triggerTimes": {
"item": [
{
"mode": "everyX",
"value": 10,
"unit": "minutes"
}
]
}
},
"name": "Cron",
"type": "n8n-nodes-base.cron",
"typeVersion": 1,
"position": [
-1100,
1020
]
},
{
"parameters": {
"operation": "multiStep",
"operations": {
"operations": [
{
"operation": "text",
"text": "Розпочато запис на \nнавчання за адресою",
"fontSize": 64,
"fontColor": "#EDEDED",
"positionX": 450,
"positionY": 100
},
{
"operation": "text",
"text": "={{$node[\"Merge1\"].json[\"class\"]}}",
"fontSize": 80,
"fontColor": "#FFFFFF",
"positionY": 400,
"font": "/usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf"
},
{
"operation": "text",
"text": "Початок занятть",
"fontSize": 36,
"fontColor": "#EDEDED",
"positionY": 520
},
{
"operation": "text",
"text": "={{$node[\"Merge1\"].json[\"date\"][\"ua\"]}}",
"fontSize": 56,
"fontColor": "#FFFFFF",
"positionY": 580,
"font": "/usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf"
}
]
},
"options": {}
},
"name": "Edit Image",
"type": "n8n-nodes-base.editImage",
"typeVersion": 1,
"position": [
1180,
760
]
},
{
"parameters": {
"resource": "file",
"binaryPropertyName": "=data",
"path": "/var/www/html/driving_school/wp-content/uploads/",
"options": {
"fileName": "new_data_rokoss.jpg"
}
},
"name": "SSH",
"type": "n8n-nodes-base.ssh",
"typeVersion": 1,
"position": [
1360,
760
],
"credentials": {
"sshPassword": {
"id": "14",
"name": "SSH Password account"
}
}
},
{
"parameters": {
"graphApiVersion": "v14.0",
"node": "me",
"edge": "accounts",
"options": {}
},
"name": "Get Pages1",
"type": "n8n-nodes-base.facebookGraphApi",
"typeVersion": 1,
"position": [
1540,
760
],
"credentials": {
"facebookGraphApi": {
"id": "36",
"name": "Facebook Graph account"
}
}
},
{
"parameters": {
"fieldToSplitOut": "data",
"options": {}
},
"name": "Split Pages1",
"type": "n8n-nodes-base.itemLists",
"typeVersion": 1,
"position": [
1720,
760
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json[\"id\"]}}",
"value2": "105101524930750"
}
]
}
},
"name": "Is Tom Travels?1",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
1900,
760
]
},
{
"parameters": {
"httpRequestMethod": "POST",
"graphApiVersion": "v14.0",
"node": "={{$json[\"id\"]}}",
"edge": "photos",
"options": {
"queryParameters": {
"parameter": [
{
"name": "access_token",
"value": "={{$json[\"access_token\"]}}"
},
{
"name": "url",
"value": "https://avtomoto25.cn.ua/wp-content/uploads/new_data_rokoss.jpg"
},
{
"name": "caption",
"value": "Розпочато нову реєстрацію на навчання в нашій автошколі. \nЗаповніть форму 🎯 https://avtomoto25.cn.ua/booking/\nабо телефонуйте ☎️ +380735650500 ☎️ +380965650500\n"
}
]
}
}
},
"name": "Facebook Graph API",
"type": "n8n-nodes-base.facebookGraphApi",
"typeVersion": 1,
"position": [
2120,
740
],
"credentials": {
"facebookGraphApi": {
"id": "36",
"name": "Facebook Graph account"
}
}
},
{
"parameters": {
"url": "={{$json[\"urls\"][\"full\"]}}",
"responseFormat": "file",
"options": {}
},
"name": "HTTP Request12",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 2,
"position": [
480,
700
]
},
{
"parameters": {
"url": "https://avtomoto25.cn.ua/wp-content/uploads/logo_banner.png",
"responseFormat": "file",
"dataPropertyName": "data2",
"options": {}
},
"name": "HTTP Request13",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 2,
"position": [
640,
860
]
},
{
"parameters": {
"operation": "composite",
"dataPropertyNameComposite": "data2",
"operator": "Plus",
"positionX": 50,
"positionY": 50,
"options": {}
},
"name": "Edit Image7",
"type": "n8n-nodes-base.editImage",
"typeVersion": 1,
"position": [
1020,
760
]
},
{
"parameters": {
"url": "https://api.unsplash.com/photos/random?query=schedule",
"options": {},
"headerParametersUi": {
"parameter": [
{
"name": "Authorization",
"value": "Client-ID SU9IXaIjfJXqKqJ1NM1zgkSjuxLVhVXICfIdWEWvUPM"
}
]
},
"queryParametersUi": {
"parameter": [
{
"name": "orientation",
"value": "landscape"
}
]
}
},
"name": "HTTP Request14",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 2,
"position": [
300,
700
]
},
{
"parameters": {
"mode": "mergeByIndex",
"join": "inner"
},
"name": "Merge",
"type": "n8n-nodes-base.merge",
"typeVersion": 1,
"position": [
860,
760
]
},
{
"parameters": {
"operation": "multiStep",
"operations": {
"operations": [
{
"operation": "resize",
"width": 1200,
"height": -1,
"resizeOption": "onlyIfLarger"
},
{
"operation": "draw",
"color": "#00000099",
"startPositionX": 25,
"startPositionY": 25,
"endPositionX": 1175,
"endPositionY": 605
},
{
"operation": "crop",
"width": 1200,
"height": 630
}
]
},
"options": {}
},
"name": "Edit Image1",
"type": "n8n-nodes-base.editImage",
"typeVersion": 1,
"position": [
640,
700
]
},
{
"parameters": {
"url": "={{ $json[\"url\"] }}",
"responseFormat": "string",
"options": {}
},
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
-700,
1020
]
},
{
"parameters": {
"extractionValues": {
"values": [
{
"key": "data",
"cssSelector": "li",
"returnArray": true
},
{
"key": "schedule",
"cssSelector": "label.checkbox-label-checked",
"returnArray": true
},
{
"key": "class",
"cssSelector": "h1.title"
}
]
},
"options": {}
},
"name": "HTML Extract3",
"type": "n8n-nodes-base.htmlExtract",
"typeVersion": 1,
"position": [
-480,
1020
]
},
{
"parameters": {
"keepOnlySet": true,
"values": {
"string": [
{
"name": "date.ua",
"value": "={{DateTime.fromFormat($json[\"data\"][0], \"dd.MM.yyyy\").setLocale('uk').toFormat('dd MMMM yyyy року')}}"
},
{
"name": "date.ru",
"value": "={{DateTime.fromFormat($json[\"data\"][0], \"dd.MM.yyyy\").setLocale('ru').toFormat('dd MMMM yyyy года')}}"
},
{
"name": "schedule.ua.day1",
"value": "={{$json[\"schedule\"][0]}}"
},
{
"name": "schedule.ua.day2",
"value": "={{$json[\"schedule\"][1]}}"
},
{
"name": "schedule.ru.day1",
"value": "={{$json[\"schedule\"][0].replace(\"понеділок\", \"понедельник\").replace(\"вівторок\", \"вторник\").replace(\"середа\", \"среда\").replace(\"четвер\", \"четверг\").replace(\"п’ятниця\", \"пятница\").replace(\"субота\", \"суббота\").replace(\"неділя\", \"воскресенье\")}}"
},
{
"name": "schedule.ru.day2",
"value": "={{$json[\"schedule\"][1].replace(\"понеділок\", \"понедельник\").replace(\"вівторок\", \"вторник\").replace(\"середа\", \"среда\").replace(\"четвер\", \"четверг\").replace(\"п’ятниця\", \"пятница\").replace(\"субота\", \"суббота\").replace(\"неділя\", \"воскресенье\")}}"
},
{
"name": "schedule.time.day1",
"value": "={{$json[\"data\"][9]}}"
},
{
"name": "schedule.time.day2",
"value": "={{$json[\"data\"][10]}}"
},
{
"name": "date.google",
"value": "={{DateTime.fromFormat($json[\"data\"][0], \"dd.MM.yyyy\").toISODate()}}"
},
{
"name": "class",
"value": "={{ $json[\"class\"] }}"
},
{
"name": "schedule.time.day3",
"value": "={{$json[\"data\"][11]}}"
},
{
"name": "schedule.ua.day3",
"value": "={{$json[\"schedule\"][2]}}"
},
{
"name": "schedule.ru.day3",
"value": "={{$json[\"schedule\"][2].replace(\"понеділок\", \"понедельник\").replace(\"вівторок\", \"вторник\").replace(\"середа\", \"среда\").replace(\"четвер\", \"четверг\").replace(\"п’ятниця\", \"пятница\").replace(\"субота\", \"суббота\").replace(\"неділя\", \"воскресенье\")}}"
}
]
},
"options": {
"dotNotation": true
}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
-260,
1020
]
},
{
"parameters": {
"docId": "tAuWNMisjXqyEkYudRcA2c",
"tableId": "Classrooms",
"returnAll": true,
"additionalOptions": {}
},
"name": "url",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
-920,
1020
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
}
},
{
"parameters": {
"docId": "tAuWNMisjXqyEkYudRcA2c",
"tableId": "Classrooms",
"returnAll": true,
"additionalOptions": {}
},
"name": "dates",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
-260,
1220
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
}
},
{
"parameters": {
"dataType": "string",
"value1": "={{ $json[\"class\"] }}",
"rules": {
"rules": [
{
"value2": "вул. Рокосовського 51"
},
{
"value2": "вул. Красносільського 59а",
"output": 1
},
{
"value2": "Проспект Перемоги 39",
"output": 2
}
]
},
"fallbackOutput": 3
},
"name": "Switch",
"type": "n8n-nodes-base.switch",
"typeVersion": 1,
"position": [
300,
1420
]
},
{
"parameters": {
"operation": "update",
"docId": "tAuWNMisjXqyEkYudRcA2c",
"tableId": "Classrooms",
"rowId": "1",
"fieldsToSend": {
"properties": [
{
"fieldId": "date_ru",
"fieldValue": "={{$json[\"date\"][\"ru\"]}}"
},
{
"fieldId": "date_ua",
"fieldValue": "={{$json[\"date\"][\"ua\"]}}"
},
{
"fieldId": "day_1_ua",
"fieldValue": "={{$json[\"schedule\"][\"ua\"][\"day1\"]}}"
},
{
"fieldId": "day_2_ua",
"fieldValue": "={{$json[\"schedule\"][\"ua\"][\"day2\"]}}"
},
{
"fieldId": "time",
"fieldValue": "={{$json[\"schedule\"][\"time\"][\"day1\"]}}"
},
{
"fieldId": "day_1_ru",
"fieldValue": "={{$json[\"schedule\"][\"ru\"][\"day1\"]}}"
},
{
"fieldId": "day_2_ru",
"fieldValue": "={{$json[\"schedule\"][\"ru\"][\"day2\"]}}"
},
{
"fieldId": "date",
"fieldValue": "={{$json[\"date\"][\"google\"]}}"
},
{
"fieldId": "time_2",
"fieldValue": "={{$json[\"schedule\"][\"time\"][\"day2\"]}}"
}
]
}
},
"name": "prospect2",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
740,
1060
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
}
},
{
"parameters": {
"mode": "removeKeyMatches",
"propertyName1": "date.google",
"propertyName2": "date"
},
"name": "Merge1",
"type": "n8n-nodes-base.merge",
"typeVersion": 1,
"position": [
-40,
1120
]
},
{
"parameters": {
"operation": "update",
"docId": "tAuWNMisjXqyEkYudRcA2c",
"tableId": "Classrooms",
"rowId": "2",
"fieldsToSend": {
"properties": [
{
"fieldId": "date_ru",
"fieldValue": "={{$json[\"date\"][\"ru\"]}}"
},
{
"fieldId": "date_ua",
"fieldValue": "={{$json[\"date\"][\"ua\"]}}"
},
{
"fieldId": "day_1_ua",
"fieldValue": "={{$json[\"schedule\"][\"ua\"][\"day1\"]}}"
},
{
"fieldId": "day_2_ua",
"fieldValue": "={{$json[\"schedule\"][\"ua\"][\"day2\"]}}"
},
{
"fieldId": "time",
"fieldValue": "={{$json[\"schedule\"][\"time\"][\"day1\"]}}"
},
{
"fieldId": "day_1_ru",
"fieldValue": "={{$json[\"schedule\"][\"ru\"][\"day1\"]}}"
},
{
"fieldId": "day_2_ru",
"fieldValue": "={{$json[\"schedule\"][\"ru\"][\"day2\"]}}"
},
{
"fieldId": "date",
"fieldValue": "={{$json[\"date\"][\"google\"]}}"
},
{
"fieldId": "time_2",
"fieldValue": "={{$json[\"schedule\"][\"time\"][\"day2\"]}}"
}
]
}
},
"name": "prospect3",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
740,
1340
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
}
},
{
"parameters": {
"operation": "update",
"calendar": "hvttbe9pijtp5c3iqiaj1rfvps%40group.calendar.google.com",
"eventId": "397fskc0hc9vfl1dqffnbjlm7k",
"updateFields": {
"allday": "yes",
"end": "= {{$json[\"date\"][\"google\"]}} 23:00:00",
"start": "= {{$json[\"date\"][\"google\"]}} 01:00:00"
}
},
"name": "Google Calendar1",
"type": "n8n-nodes-base.googleCalendar",
"typeVersion": 1,
"position": [
740,
1480
],
"credentials": {
"googleCalendarOAuth2Api": {
"id": "6",
"name": "Google Calendar account"
}
}
},
{
"parameters": {
"operation": "update",
"docId": "tAuWNMisjXqyEkYudRcA2c",
"tableId": "Classrooms",
"rowId": "3",
"fieldsToSend": {
"properties": [
{
"fieldId": "date_ru",
"fieldValue": "={{$json[\"date\"][\"ru\"]}}"
},
{
"fieldId": "date_ua",
"fieldValue": "={{$json[\"date\"][\"ua\"]}}"
},
{
"fieldId": "day_1_ua",
"fieldValue": "={{$json[\"schedule\"][\"ua\"][\"day1\"]}}"
},
{
"fieldId": "day_2_ua",
"fieldValue": "={{$json[\"schedule\"][\"ua\"][\"day2\"]}}"
},
{
"fieldId": "time",
"fieldValue": "={{$json[\"schedule\"][\"time\"][\"day1\"]}}"
},
{
"fieldId": "day_1_ru",
"fieldValue": "={{$json[\"schedule\"][\"ru\"][\"day1\"]}}"
},
{
"fieldId": "day_2_ru",
"fieldValue": "={{$json[\"schedule\"][\"ru\"][\"day2\"]}}"
},
{
"fieldId": "date",
"fieldValue": "={{$json[\"date\"][\"google\"]}}"
},
{
"fieldId": "time_2",
"fieldValue": "={{$json[\"schedule\"][\"time\"][\"day2\"]}}"
},
{
"fieldId": "time_3",
"fieldValue": "={{$json[\"schedule\"][\"time\"][\"day3\"]}}"
},
{
"fieldId": "day_3_ua",
"fieldValue": "={{$json[\"schedule\"][\"ua\"][\"day3\"]}}"
},
{
"fieldId": "day_3_ru",
"fieldValue": "={{$json[\"schedule\"][\"ru\"][\"day3\"]}}"
}
]
}
},
"name": "prospect4",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
740,
1640
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
}
},
{
"parameters": {
"operation": "update",
"calendar": "hvttbe9pijtp5c3iqiaj1rfvps%40group.calendar.google.com",
"eventId": "3ptu0erou5f816kglu1f2p0p28",
"updateFields": {
"allday": "yes",
"end": "= {{$json[\"date\"][\"google\"]}} 23:00:00",
"start": "= {{$json[\"date\"][\"google\"]}} 01:00:00"
}
},
"name": "Google Calendar2",
"type": "n8n-nodes-base.googleCalendar",
"typeVersion": 1,
"position": [
740,
1780
],
"credentials": {
"googleCalendarOAuth2Api": {
"id": "6",
"name": "Google Calendar account"
}
}
}
],
"connections": {
"Cron": {
"main": [
[
{
"node": "url",
"type": "main",
"index": 0
}
]
]
},
"Get Pages1": {
"main": [
[
{
"node": "Split Pages1",
"type": "main",
"index": 0
}
]
]
},
"Split Pages1": {
"main": [
[
{
"node": "Is Tom Travels?1",
"type": "main",
"index": 0
}
]
]
},
"Is Tom Travels?1": {
"main": [
[
{
"node": "Facebook Graph API",
"type": "main",
"index": 0
}
]
]
},
"SSH": {
"main": [
[
{
"node": "Get Pages1",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request12": {
"main": [
[
{
"node": "Edit Image1",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request13": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Edit Image7": {
"main": [
[
{
"node": "Edit Image",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request14": {
"main": [
[
{
"node": "HTTP Request12",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Edit Image7",
"type": "main",
"index": 0
}
]
]
},
"Edit Image1": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Edit Image": {
"main": [
[
{
"node": "SSH",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "HTML Extract3",
"type": "main",
"index": 0
}
]
]
},
"HTML Extract3": {
"main": [
[
{
"node": "Set",
"type": "main",
"index": 0
}
]
]
},
"Set": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"url": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"dates": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Google Calendar",
"type": "main",
"index": 0
},
{
"node": "prospect2",
"type": "main",
"index": 0
}
],
[
{
"node": "prospect3",
"type": "main",
"index": 0
},
{
"node": "Google Calendar1",
"type": "main",
"index": 0
}
],
[
{
"node": "prospect4",
"type": "main",
"index": 0
},
{
"node": "Google Calendar2",
"type": "main",
"index": 0
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
},
{
"node": "HTTP Request14",
"type": "main",
"index": 0
}
]
]
}
},
"createdAt": "2022-07-22T17:53:56.513Z",
"updatedAt": "2022-07-30T18:54:01.782Z",
"settings": {
"errorWorkflow": "25"
},
"staticData": null,
"pinData": {},
"tags": [
{
"id": "1",
"name": "avtomoto25",
"createdAt": "2022-05-10T18:06:30.022Z",
"updatedAt": "2022-05-10T18:06:30.022Z"
}
]
}