760 lines
16 KiB
JSON
Executable File
760 lines
16 KiB
JSON
Executable File
{
|
||
"createdAt": "2022-06-23T08:35:12.154Z",
|
||
"updatedAt": "2023-01-05T18:00:10.484Z",
|
||
"id": "39",
|
||
"name": "avtomoto25 messages",
|
||
"active": true,
|
||
"nodes": [
|
||
{
|
||
"parameters": {},
|
||
"name": "Start",
|
||
"type": "n8n-nodes-base.start",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-240,
|
||
0
|
||
],
|
||
"id": "d6055ed9-a659-41ec-9374-abe41f7237ae"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"graphApiVersion": "v14.0",
|
||
"node": "me",
|
||
"edge": "accounts",
|
||
"options": {}
|
||
},
|
||
"name": "Get Pages1",
|
||
"type": "n8n-nodes-base.facebookGraphApi",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
0,
|
||
160
|
||
],
|
||
"id": "021a30f6-2ddb-4e69-a032-1809bc5a9003",
|
||
"credentials": {
|
||
"facebookGraphApi": {
|
||
"id": "36",
|
||
"name": "Facebook Graph account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"fieldToSplitOut": "data",
|
||
"options": {}
|
||
},
|
||
"name": "Split Pages1",
|
||
"type": "n8n-nodes-base.itemLists",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
220,
|
||
160
|
||
],
|
||
"id": "7030dc12-89c3-4942-82d4-067829315a6b"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"graphApiVersion": "v14.0",
|
||
"node": "={{$json[\"id\"]}}",
|
||
"edge": "conversations",
|
||
"options": {
|
||
"queryParameters": {
|
||
"parameter": [
|
||
{
|
||
"name": "access_token",
|
||
"value": "={{$json[\"access_token\"]}}"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"name": "Facebook Graph API",
|
||
"type": "n8n-nodes-base.facebookGraphApi",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
620,
|
||
140
|
||
],
|
||
"id": "f8e4a9c5-4a1d-441e-a015-a97d0f52ef9b",
|
||
"credentials": {
|
||
"facebookGraphApi": {
|
||
"id": "36",
|
||
"name": "Facebook Graph account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"fieldToSplitOut": "data",
|
||
"include": "selectedOtherFields",
|
||
"fieldsToInclude": {
|
||
"fields": [
|
||
{
|
||
"fieldName": "token"
|
||
}
|
||
]
|
||
},
|
||
"options": {}
|
||
},
|
||
"id": "ebc0aa0c-fd48-40d6-bce9-5d50af0796d5",
|
||
"name": "Item Lists",
|
||
"type": "n8n-nodes-base.itemLists",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
1020,
|
||
140
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"graphApiVersion": "v14.0",
|
||
"node": "={{$json[\"data\"][\"id\"]}}",
|
||
"edge": "messages",
|
||
"options": {
|
||
"fields": {
|
||
"field": [
|
||
{
|
||
"name": "message"
|
||
},
|
||
{
|
||
"name": "created_time"
|
||
},
|
||
{
|
||
"name": "from"
|
||
},
|
||
{
|
||
"name": "to"
|
||
},
|
||
{
|
||
"name": "tags"
|
||
},
|
||
{
|
||
"name": "id"
|
||
}
|
||
]
|
||
},
|
||
"queryParameters": {
|
||
"parameter": [
|
||
{
|
||
"name": "access_token",
|
||
"value": "={{$json[\"token\"]}}"
|
||
},
|
||
{
|
||
"name": "fields ",
|
||
"value": "message"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"name": "Facebook Graph API1",
|
||
"type": "n8n-nodes-base.facebookGraphApi",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
1520,
|
||
320
|
||
],
|
||
"id": "2c143579-e33d-4601-a23c-3b78479fd064",
|
||
"credentials": {
|
||
"facebookGraphApi": {
|
||
"id": "36",
|
||
"name": "Facebook Graph account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"conditions": {
|
||
"string": [
|
||
{
|
||
"value1": "={{$json[\"id\"]}}",
|
||
"value2": "105101524930750"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"name": "avtomoto",
|
||
"type": "n8n-nodes-base.if",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
420,
|
||
160
|
||
],
|
||
"id": "d0d185dd-e2a8-48fd-af9e-62d35d937446"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"graphApiVersion": "v14.0",
|
||
"node": "m_pO1GARrieV528mZQAQ_Hc7CQlEvcIVIJYs2vXGQiJG_Pwu3AvlcVipBUk4cfcCQTSp78elD9bRQwCm0wm4k08A",
|
||
"options": {
|
||
"fields": {
|
||
"field": [
|
||
{
|
||
"name": "message"
|
||
}
|
||
]
|
||
},
|
||
"queryParameters": {
|
||
"parameter": [
|
||
{
|
||
"name": "access_token",
|
||
"value": "EAAHY4Ui0IJgBAE4R0Ay5puCrElc6arG3vlziIUyeNjm6KJkIgQHV9l1Sverlu5F5ly2b2yXBMG04ZCmuPUByqxDp3RKcQyE7BxAd8n4UX2xEjYGec0s9CjM0qE4gUXJqgmEuVBzF1ux1z5LJ9mE79wq1rKeZC3VS5gepXrInpCtpQg8cjuMxo8MnpWtYEZD"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"name": "Facebook Graph API2",
|
||
"type": "n8n-nodes-base.facebookGraphApi",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
620,
|
||
380
|
||
],
|
||
"id": "6979e524-17f4-4480-97d5-dab120b9bd19",
|
||
"credentials": {
|
||
"facebookGraphApi": {
|
||
"id": "36",
|
||
"name": "Facebook Graph account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"values": {
|
||
"string": [
|
||
{
|
||
"name": "token",
|
||
"value": "={{$node[\"avtomoto\"].json[\"access_token\"]}}"
|
||
}
|
||
]
|
||
},
|
||
"options": {}
|
||
},
|
||
"id": "dcd323a4-cb2b-49ff-99c1-d8b55e9b321d",
|
||
"name": "Set",
|
||
"type": "n8n-nodes-base.set",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
820,
|
||
140
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"fieldToSplitOut": "data",
|
||
"options": {}
|
||
},
|
||
"id": "5221f936-d736-4aba-a775-1a4a9c911eb7",
|
||
"name": "Item Lists1",
|
||
"type": "n8n-nodes-base.itemLists",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
1740,
|
||
320
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"operation": "limit"
|
||
},
|
||
"id": "7c533190-35aa-44a5-a26f-2eba9797d562",
|
||
"name": "Item Lists2",
|
||
"type": "n8n-nodes-base.itemLists",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
1920,
|
||
320
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"graphApiVersion": "v14.0",
|
||
"node": "108035462020822",
|
||
"options": {
|
||
"queryParameters": {
|
||
"parameter": [
|
||
{
|
||
"name": "access_token",
|
||
"value": "EAAHY4Ui0IJgBAE4R0Ay5puCrElc6arG3vlziIUyeNjm6KJkIgQHV9l1Sverlu5F5ly2b2yXBMG04ZCmuPUByqxDp3RKcQyE7BxAd8n4UX2xEjYGec0s9CjM0qE4gUXJqgmEuVBzF1ux1z5LJ9mE79wq1rKeZC3VS5gepXrInpCtpQg8cjuMxo8MnpWtYEZD"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"name": "Facebook Graph API3",
|
||
"type": "n8n-nodes-base.facebookGraphApi",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
620,
|
||
520
|
||
],
|
||
"id": "49fd15dd-5f68-4790-aabd-04b2a11b272b",
|
||
"credentials": {
|
||
"facebookGraphApi": {
|
||
"id": "36",
|
||
"name": "Facebook Graph account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"conditions": {
|
||
"dateTime": [
|
||
{
|
||
"value1": "={{$json[\"data\"][\"updated_time\"]}}",
|
||
"operation": "=after",
|
||
"value2": "={{$today.minus({days: 7})}}"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"id": "afbea4c5-4c5e-41d9-aede-8c9e5cf4e389",
|
||
"name": "IF",
|
||
"type": "n8n-nodes-base.if",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
1220,
|
||
140
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"triggerTimes": {
|
||
"item": [
|
||
{
|
||
"mode": "everyX",
|
||
"value": 10,
|
||
"unit": "minutes"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"id": "24881d90-6d02-4af4-9903-7d5973ed2d7b",
|
||
"name": "Cron",
|
||
"type": "n8n-nodes-base.cron",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-240,
|
||
160
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"operation": "create",
|
||
"docId": "tAuWNMisjXqyEkYudRcA2c",
|
||
"tableId": "Messages",
|
||
"fieldsToSend": {
|
||
"properties": [
|
||
{
|
||
"fieldId": "date",
|
||
"fieldValue": "={{ $json[\"created_time\"] }}"
|
||
},
|
||
{
|
||
"fieldId": "user_id",
|
||
"fieldValue": "={{$json[\"from\"][\"id\"]}}"
|
||
},
|
||
{
|
||
"fieldId": "message_id",
|
||
"fieldValue": "={{ $json[\"id\"] }}"
|
||
},
|
||
{
|
||
"fieldId": "message",
|
||
"fieldValue": "={{ $json[\"message\"] }}"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"id": "bedb684f-8790-4142-b4cf-bd97a639d3da",
|
||
"name": "Grist",
|
||
"type": "n8n-nodes-base.grist",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
2160,
|
||
120
|
||
],
|
||
"credentials": {
|
||
"gristApi": {
|
||
"id": "21",
|
||
"name": "Grist account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"graphApiVersion": "v14.0",
|
||
"node": "={{$json[\"data\"][\"id\"]}}",
|
||
"edge": "messages",
|
||
"options": {
|
||
"fields": {
|
||
"field": [
|
||
{
|
||
"name": "message"
|
||
},
|
||
{
|
||
"name": "created_time"
|
||
},
|
||
{
|
||
"name": "from"
|
||
},
|
||
{
|
||
"name": "to"
|
||
},
|
||
{
|
||
"name": "tags"
|
||
},
|
||
{
|
||
"name": "id"
|
||
}
|
||
]
|
||
},
|
||
"queryParameters": {
|
||
"parameter": [
|
||
{
|
||
"name": "access_token",
|
||
"value": "={{$json[\"token\"]}}"
|
||
},
|
||
{
|
||
"name": "fields ",
|
||
"value": "message"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"name": "Facebook Graph API4",
|
||
"type": "n8n-nodes-base.facebookGraphApi",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
1360,
|
||
-160
|
||
],
|
||
"id": "4ca110a1-3d4c-4888-9bdc-76862fab4791",
|
||
"credentials": {
|
||
"facebookGraphApi": {
|
||
"id": "36",
|
||
"name": "Facebook Graph account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"fieldToSplitOut": "data",
|
||
"options": {}
|
||
},
|
||
"id": "665f7bc0-aa15-478a-984f-30564d104da5",
|
||
"name": "Item Lists3",
|
||
"type": "n8n-nodes-base.itemLists",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
1560,
|
||
-160
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"operation": "limit"
|
||
},
|
||
"id": "9be52810-7021-48cc-a92f-0602e9ca62b4",
|
||
"name": "Item Lists4",
|
||
"type": "n8n-nodes-base.itemLists",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
2320,
|
||
0
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"conditions": {
|
||
"string": [
|
||
{
|
||
"value1": "={{$json[\"from\"][\"id\"]}}",
|
||
"operation": "notContains",
|
||
"value2": "105101524930750"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"id": "1c0fe986-90b7-4446-bb17-c7454f7f0678",
|
||
"name": "IF1",
|
||
"type": "n8n-nodes-base.if",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
1740,
|
||
-160
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"mode": "removeKeyMatches",
|
||
"propertyName1": "id",
|
||
"propertyName2": "message_id"
|
||
},
|
||
"id": "9110d11a-0d12-4a69-892e-e4cbd6c2d73c",
|
||
"name": "Merge",
|
||
"type": "n8n-nodes-base.merge",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
1960,
|
||
-40
|
||
]
|
||
},
|
||
{
|
||
"parameters": {
|
||
"docId": "tAuWNMisjXqyEkYudRcA2c",
|
||
"tableId": "Messages",
|
||
"returnAll": true,
|
||
"additionalOptions": {}
|
||
},
|
||
"id": "4f62146b-cc28-4621-8076-e608f0ac4058",
|
||
"name": "Grist1",
|
||
"type": "n8n-nodes-base.grist",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
1740,
|
||
80
|
||
],
|
||
"credentials": {
|
||
"gristApi": {
|
||
"id": "21",
|
||
"name": "Grist account"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"chatId": "-1001369967688",
|
||
"text": "=Заявку скасовано",
|
||
"additionalFields": {
|
||
"parse_mode": "Markdown"
|
||
}
|
||
},
|
||
"name": "Telegram2",
|
||
"type": "n8n-nodes-base.telegram",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
440,
|
||
400
|
||
],
|
||
"id": "2669e981-600b-424e-853b-c4b03f85042a",
|
||
"credentials": {
|
||
"telegramApi": {
|
||
"id": "15",
|
||
"name": "avtomoto25"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"chatId": "-1001369967688",
|
||
"text": "=📫 <b>Повідомлення у Facebook</b> 📫\nвід: <b>{{$json[\"from\"][\"id\"]}}</b>\nповідомлення: <b>{{$json[\"message\"]}}</b>",
|
||
"additionalFields": {
|
||
"parse_mode": "HTML"
|
||
}
|
||
},
|
||
"id": "9737e0ab-7b49-4dc6-8075-869878647ae7",
|
||
"name": "Telegram",
|
||
"type": "n8n-nodes-base.telegram",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
2180,
|
||
-180
|
||
],
|
||
"credentials": {
|
||
"telegramApi": {
|
||
"id": "15",
|
||
"name": "avtomoto25"
|
||
}
|
||
}
|
||
}
|
||
],
|
||
"connections": {
|
||
"Get Pages1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Split Pages1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Split Pages1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "avtomoto",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Facebook Graph API": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Set",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Item Lists": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "IF",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"avtomoto": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Facebook Graph API",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Facebook Graph API1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Item Lists1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Set": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Item Lists",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Item Lists1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Item Lists2",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"IF": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Facebook Graph API4",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Cron": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Get Pages1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Facebook Graph API4": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Item Lists3",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Item Lists3": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "IF1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"IF1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Merge",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Merge": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Grist",
|
||
"type": "main",
|
||
"index": 0
|
||
},
|
||
{
|
||
"node": "Telegram",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Grist1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Merge",
|
||
"type": "main",
|
||
"index": 1
|
||
}
|
||
]
|
||
]
|
||
}
|
||
},
|
||
"settings": {
|
||
"saveExecutionProgress": "DEFAULT",
|
||
"errorWorkflow": "25"
|
||
},
|
||
"staticData": null,
|
||
"pinData": {},
|
||
"versionId": "f975a152-519c-4436-8d03-55aa043942c0",
|
||
"triggerCount": 1,
|
||
"tags": [
|
||
{
|
||
"createdAt": "2022-05-10T18:06:30.022Z",
|
||
"updatedAt": "2022-05-10T18:06:30.022Z",
|
||
"id": "1",
|
||
"name": "avtomoto25"
|
||
}
|
||
]
|
||
} |