Files
n8n/flows/14.json

489 lines
12 KiB
JSON
Executable File
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.
{
"createdAt": "2022-04-30T16:57:58.523Z",
"updatedAt": "2023-01-13T19:49:46.404Z",
"id": "14",
"name": "avtmoto25 cf",
"active": true,
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
-420,
640
],
"id": "06488dd8-f7bc-486f-87e2-15674e4a8ddb"
},
{
"parameters": {
"httpMethod": "POST",
"path": "ea62db5f-f87b-48cb-9b12-e6cf7810324b",
"options": {}
},
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
-880,
-40
],
"webhookId": "ea62db5f-f87b-48cb-9b12-e6cf7810324b",
"id": "b3953002-65f1-476f-97ce-3328c4788f3e"
},
{
"parameters": {
"chatId": "-1001369967688",
"text": "=🔔‌*Нова заявка на навчання*🔔\nІм'я: {{$json[\"body\"][\"your-name\"]}}\nemail: {{$json[\"body\"][\"your-email\"]}}\nКонтактний номер: {{$json[\"body\"][\"your-phone\"]}}\nХочу навчатися за адресою: {{$json[\"body\"][\"your-class\"]}}\nКатегорія: {{$json[\"body\"][\"your-category\"]}}\nДжерело інформації: {{$json[\"body\"][\"your-source\"]}}",
"replyMarkup": "inlineKeyboard",
"inlineKeyboard": {
"rows": [
{
"row": {
"buttons": [
{
"text": "Опрацьовано",
"additionalFields": {
"callback_data": "=accept-{{$json[\"date\"]}}"
}
},
{
"text": "Спам",
"additionalFields": {
"callback_data": "reject"
}
}
]
}
}
]
},
"additionalFields": {
"parse_mode": "Markdown"
}
},
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1,
"position": [
-100,
160
],
"credentials": {
"telegramApi": {
"id": "15",
"name": "avtomoto25"
}
},
"id": "0a053993-2975-4d1a-952b-ee61a43fdf0b"
},
{
"parameters": {
"updates": [
"callback_query"
],
"additionalFields": {}
},
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1,
"position": [
-400,
380
],
"webhookId": "d6c9273d-aa32-4a5e-942b-ad92d38d6ecd",
"credentials": {
"telegramApi": {
"id": "15",
"name": "avtomoto25"
}
},
"id": "15ecb380-386d-4708-9c39-5cea8c861c16"
},
{
"parameters": {
"dataType": "string",
"value1": "={{$json[\"callback_query\"][\"data\"]}}",
"rules": {
"rules": [
{
"operation": "contains",
"value2": "accept"
},
{
"value2": "reject",
"output": 1
}
]
}
},
"name": "Switch",
"type": "n8n-nodes-base.switch",
"typeVersion": 1,
"position": [
-140,
380
],
"id": "b7d4b8ce-bdc8-4f3c-9aa2-06449d565fd9"
},
{
"parameters": {
"chatId": "-1001369967688",
"text": "=Користувача зараховано",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"name": "Telegram1",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1,
"position": [
800,
420
],
"credentials": {
"telegramApi": {
"id": "15",
"name": "avtomoto25"
}
},
"disabled": true,
"id": "fa317967-65ed-4fbe-9a3b-c91d251eb98a"
},
{
"parameters": {
"chatId": "-1001369967688",
"text": "=Заявку скасовано",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"name": "Telegram2",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1,
"position": [
220,
440
],
"credentials": {
"telegramApi": {
"id": "15",
"name": "avtomoto25"
}
},
"id": "0df34b87-5168-4a62-9690-17ec5ba24187"
},
{
"parameters": {
"operation": "create",
"docId": "tAuWNMisjXqyEkYudRcA2c",
"tableId": "Registration",
"fieldsToSend": {
"properties": [
{
"fieldId": "=name",
"fieldValue": "=Ім'я: {{$json[\"body\"][\"your-name\"]}}\nemail: {{$json[\"body\"][\"your-email\"]}}\nКонтактний номер: {{$json[\"body\"][\"your-phone\"]}}\nХочу навчатися за адресою: {{$json[\"body\"][\"your-class\"]}}\nДжерело інформації: {{$json[\"body\"][\"your-source\"]}}\n\n{{$node[\"Webhook\"].paramet{{$node[\"Webhook\"].parameter[\"authentication\"]}}er[\"path\"]}}"
}
]
}
},
"name": "Grist",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
260,
660
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
},
"disabled": true,
"id": "d5cdc765-36d4-4927-aee2-0de5dce0ab73"
},
{
"parameters": {
"operation": "sendTemplate",
"templateId": 3935065,
"additionalFields": {}
},
"name": "Mailjet",
"type": "n8n-nodes-base.mailjet",
"typeVersion": 1,
"position": [
240,
0
],
"credentials": {
"mailjetEmailApi": {
"id": "27",
"name": "Mailjet Email account"
}
},
"disabled": true,
"id": "47c66bf4-6ab7-4737-ad69-bf94b2ef6579"
},
{
"parameters": {
"operation": "create",
"docId": "tAuWNMisjXqyEkYudRcA2c",
"tableId": "Registration",
"fieldsToSend": {
"properties": [
{
"fieldId": "name",
"fieldValue": "={{$json[\"body\"][\"your-name\"]}}"
},
{
"fieldId": "email",
"fieldValue": "={{$json[\"body\"][\"your-email\"]}}"
},
{
"fieldId": "phone",
"fieldValue": "={{$json[\"body\"][\"your-phone\"]}}"
},
{
"fieldId": "adress",
"fieldValue": "={{$json[\"body\"][\"your-class\"]}}"
},
{
"fieldId": "source",
"fieldValue": "={{$json[\"body\"][\"your-source\"]}}"
},
{
"fieldId": "id2",
"fieldValue": "={{$json[\"date\"]}}"
},
{
"fieldId": "categoty",
"fieldValue": "={{$json[\"body\"][\"your-category\"][0]}}"
}
]
}
},
"name": "Записываем пользователя в таблицу",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
-100,
-40
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
},
"id": "57ae0863-cd5e-4f17-8ff8-95ac02e96448"
},
{
"parameters": {
"values": {
"string": [
{
"name": "date",
"value": "={{$now.toString()}}"
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
-620,
-40
],
"id": "5bd8b31d-77f3-4496-a9ca-27bd389987a6"
},
{
"parameters": {
"docId": "tAuWNMisjXqyEkYudRcA2c",
"tableId": "Registration",
"returnAll": true,
"additionalOptions": {}
},
"name": "ищем запись",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
220,
260
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
},
"id": "d09f0c67-b0e4-4c38-9e5e-ca2663f42740"
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json[\"id2\"]}}",
"operation": "contains",
"value2": "={{$node[\"Telegram Trigger\"].json[\"callback_query\"][\"data\"]}}"
}
]
}
},
"name": "IF",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
420,
260
],
"id": "9676a29f-fad7-4024-bdaa-09d58f47cfc2"
},
{
"parameters": {
"operation": "update",
"docId": "tAuWNMisjXqyEkYudRcA2c",
"tableId": "Registration",
"rowId": "={{$json[\"id\"]}}",
"fieldsToSend": {
"properties": [
{
"fieldId": "accepted",
"fieldValue": "true"
}
]
}
},
"name": "Grist1",
"type": "n8n-nodes-base.grist",
"typeVersion": 1,
"position": [
660,
200
],
"credentials": {
"gristApi": {
"id": "21",
"name": "Grist account"
}
},
"id": "1c05a9c3-7ec5-4926-ae13-9d98a9d5bdb4"
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Set",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Grist",
"type": "main",
"index": 0
},
{
"node": "ищем запись",
"type": "main",
"index": 0
}
],
[
{
"node": "Telegram2",
"type": "main",
"index": 0
}
]
]
},
"Записываем пользователя в таблицу": {
"main": [
[
{
"node": "Mailjet",
"type": "main",
"index": 0
}
]
]
},
"Set": {
"main": [
[
{
"node": "Записываем пользователя в таблицу",
"type": "main",
"index": 0
},
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"ищем запись": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"IF": {
"main": [
[
{
"node": "Grist1",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"saveExecutionProgress": "DEFAULT",
"errorWorkflow": "25"
},
"staticData": null,
"pinData": null,
"versionId": "a00e06ec-bd4a-4955-a11d-764723bc5377",
"triggerCount": 2,
"tags": [
{
"createdAt": "2022-05-10T18:06:30.022Z",
"updatedAt": "2022-05-10T18:06:30.022Z",
"id": "1",
"name": "avtomoto25"
}
]
}