This workflow follows the Google Sheets → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "TGBot",
"nodes": [
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
"text": "=\u041f\u0440\u0438\u0432\u0456\u0442! \ud83d\udc4b\n\u042f \u2014 \u0431\u043e\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0443 \u043d\u0430 \u0434\u0456\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443. \u0414\u0430\u0432\u0430\u0439 \u043f\u043e\u0437\u043d\u0430\u0439\u043e\u043c\u0438\u043c\u043e\u0441\u044c! \u042f\u043a \u0442\u0435\u0431\u0435 \u0437\u0432\u0430\u0442\u0438? (\u041c\u043e\u0436\u043d\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 Telegram username)",
"replyMarkup": "replyKeyboard",
"replyKeyboardOptions": {},
"additionalFields": {}
},
"name": "Send Reply",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1,
"position": [
-1072,
-1072
],
"id": "00ab4951-36c5-45de-a80b-fed5f79d1ee5",
"alwaysOutputData": false,
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "const items = $input.all();\nconst results = [];\n\nfor (const item of items) {\n const message = item.json.message;\n if (!message?.text) continue;\n\n const chatId = message.chat.id.toString();\n const username = message.from?.username || 'not_provided';\n const text = message.text.trim();\n\n let response = '';\n let userDataToSave = null;\n let shouldRunAgent = false;\n\n if (text === '/start') {\n \n } else {\n // \u0422\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0438\u043c\u044f\n const name = text;\n response = `\u0414\u044f\u043a\u0443\u044e, ${name}! \u0422\u0435\u043f\u0435\u0440 \u043e\u0447\u0456\u043a\u0443\u0454\u043c\u043e \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043d\u044f.`;\n userDataToSave = {\n chatId,\n username,\n name,\n status: 'waiting_for_confirmation'\n };\n shouldRunAgent = true;\n }\n\n results.push({\n json: {\n chatId,\n response,\n userDataToSave,\n shouldRunAgent\n }\n });\n}\n\nreturn results;\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-2000,
-1168
],
"id": "e7864115-655b-4987-86ba-09e561b2d65d",
"name": "Process & State",
"alwaysOutputData": true
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit?usp=sharing",
"mode": "url"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "\u041b\u0438\u0441\u04421",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"\u0406\u043c\u2019\u044f": "={{ $node[\"Process & State\"].json.userDataToSave.name }}",
"Telegram(username)": "={{ $node[\"Process & State\"].json.userDataToSave.username }}",
"\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443": "https://docs.google.com/forms/d/e/1FAIpQLScMqORRKaPtsb0v_k_RoiDWtNJAeDOajOCXZ7kscCOlH86Qjg/viewform?usp=header",
"\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)": "\u041d\u0456",
"\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456": "-",
"\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456": "-",
"\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442": "-"
},
"matchingColumns": [],
"schema": [
{
"id": "\u0406\u043c\u2019\u044f",
"displayName": "\u0406\u043c\u2019\u044f",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Telegram(username)",
"displayName": "Telegram(username)",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"displayName": "\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"displayName": "\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443",
"displayName": "\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)",
"displayName": "\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442",
"displayName": "\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.6,
"position": [
-576,
-1536
],
"id": "004c8a05-2712-4f24-8c58-466334912c23",
"name": "Append row in sheet",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
"text": "=\u0414\u044f\u043a\u0443\u044e, {{ $('Process & State').item.json.userDataToSave.name }}!\n\u041e\u0441\u044c \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0430\u043d\u043a\u0435\u0442\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u043d\u044f: https://docs.google.com/forms/d/e/1FAIpQLSdb6kYZjnK_uHNesQ2RPSHgNIwMHTUnHzmIwjILgooww6ydAg/viewform",
"replyMarkup": "replyKeyboard",
"replyKeyboard": {
"rows": [
{
"row": {
"buttons": [
{
"text": "\u041f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u0436\u0435\u043d\u043d\u044f \u0444\u043e\u0440\u043c\u0438",
"additionalFields": {}
}
]
}
}
]
},
"replyKeyboardOptions": {
"resize_keyboard": true
},
"additionalFields": {
"appendAttribution": false,
"parse_mode": "HTML"
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
-736,
-1536
],
"id": "b978ed36-df0e-4b8a-8c18-a903311af32c",
"name": "Send a text message",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "e8a680f4-6440-4002-9da1-35e22ea087ca",
"leftValue": "={{ $('Process & State').item.json.shouldRunAgent }}",
"rightValue": "",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
}
}
],
"combinator": "and"
},
"looseTypeValidation": true,
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-1328,
-1168
],
"id": "c211d868-5a43-4abc-b77a-581670414e6b",
"name": "If"
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"text": "=\u0414\u044f\u043a\u0443\u044e \u0437\u0430 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043d\u044f! \n\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c\u043e \u0434\u043e \u0432\u0438\u0431\u043e\u0440\u0443 \u0434\u0430\u0442\u0438 \u0442\u0430 \u0447\u0430\u0441\u0443 \u0434\u043b\u044f \u0434\u0456\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438.",
"replyMarkup": "replyKeyboardRemove",
"replyKeyboardRemove": {
"remove_keyboard": true
},
"additionalFields": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
-736,
-1744
],
"id": "884c791b-d854-4752-a60f-0f7d9e53cd1a",
"name": "Send a text message1",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "update",
"documentId": {
"__rl": true,
"value": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit?usp=sharing",
"mode": "url"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "\u041b\u0438\u0441\u04421",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)": "\u0422\u0430\u043a",
"Telegram(username)": "={{ $json.result.chat.username }}"
},
"matchingColumns": [
"Telegram(username)"
],
"schema": [
{
"id": "\u0406\u043c\u2019\u044f",
"displayName": "\u0406\u043c\u2019\u044f",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Telegram(username)",
"displayName": "Telegram(username)",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"displayName": "\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"displayName": "\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443",
"displayName": "\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)",
"displayName": "\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442",
"displayName": "\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "row_number",
"displayName": "row_number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "number",
"canBeUsedToMatch": true,
"readOnly": true,
"removed": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.6,
"position": [
-560,
-1744
],
"id": "82b3e010-b4a5-4881-9df5-52b8083b571c",
"name": "Update row in sheet",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"updates": [
"message",
"callback_query"
],
"additionalFields": {}
},
"type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1.2,
"position": [
-2160,
-1168
],
"id": "7600f808-f73c-4370-a203-27321ece169e",
"name": "Telegram Trigger",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"method": "POST",
"url": "https://api.telegram.org/bot<TokenTelegramBot>/sendMessage",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ $json.telegramBody }}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-592,
-1360
],
"id": "a7a179ce-bc06-4f65-85c9-7aad328a9afb",
"name": "CreateTelegramMessage"
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $('Process & State').item.json.userDataToSave.name }}",
"rightValue": "\u041f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u0436\u0435\u043d\u043d\u044f \u0444\u043e\u0440\u043c\u0438",
"operator": {
"type": "string",
"operation": "equals"
},
"id": "8dda4f29-f006-4f41-baff-28634f431946"
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "2bb90dcd-a515-4b19-bed2-d026aa4c6451",
"leftValue": "={{ $('Process & State').item.json.userDataToSave.name }}",
"rightValue": "=^(?!\\d{4}-\\d{2}-\\d{2}$)(?!\\d{2}:\\d{2}$)(?!\u041f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0431\u0440\u043e\u043d\u044c$).+",
"operator": {
"type": "string",
"operation": "regex"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "54eaa06f-6912-473f-9f6d-5daf232eb88b",
"leftValue": "={{ $('Process & State').item.json.userDataToSave.name }}",
"rightValue": "=^\\d{4}-\\d{2}-\\d{2}$",
"operator": {
"type": "string",
"operation": "regex"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "7470fa66-db6f-4d12-81f6-59f00a933cd8",
"leftValue": "={{ $('Process & State').item.json.userDataToSave.name }}",
"rightValue": "^\\d{2}:\\d{2}$",
"operator": {
"type": "string",
"operation": "regex"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "262a9eee-e0d4-45f6-b228-b248a2d26af7",
"leftValue": "={{ $('Process & State').item.json.userDataToSave.name }}",
"rightValue": "\u041f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0431\u0440\u043e\u043d\u044c",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
}
]
},
"looseTypeValidation": true,
"options": {}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
-1104,
-1344
],
"id": "ebe1ee29-1237-481d-862c-b6502875aaa6",
"name": "Switch"
},
{
"parameters": {
"jsCode": "const slots = $('GetSlotsAll').first().json.collection;\nconst uniqueDates = [...new Set(slots.map(s => s.start_time.slice(0,10)))];\n\nconst reply_markup = {\n keyboard: uniqueDates.map(date => [ date ]), \n one_time_keyboard: true,\n resize_keyboard: true\n};\n\nreturn [{\n json: {\n information:{\n chat_id: $('Telegram Trigger').first().json.message.chat.id, \n text: \"\u0404 \u0432\u0456\u043b\u044c\u043d\u0456 \u0447\u0430\u0441\u0438 \u043d\u0430 \u0442\u0430\u043a\u0456 \u0434\u043d\u0456. \u041e\u0431\u0435\u0440\u0456\u0442\u044c \u0434\u0430\u0442\u0443:\",\n reply_markup \n }\n }\n}];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-400,
-1744
],
"id": "4c03c168-6649-489d-ada3-2560b0c3fed0",
"name": "MessageForPerson"
},
{
"parameters": {
"method": "POST",
"url": "https://api.telegram.org/bot<YOUR TOKEN>/sendMessage",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ $json.information }}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-224,
-1744
],
"id": "2f6d8dca-a499-480d-9d9e-2edf14790919",
"name": "CreateTelegramMessage1"
},
{
"parameters": {
"operation": "update",
"documentId": {
"__rl": true,
"value": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit?usp=sharing",
"mode": "url"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "\u041b\u0438\u0441\u04421",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"Telegram(username)": "={{ $json.result.chat.username }}",
"\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456": "={{ $('Process & State').item.json.userDataToSave.name }}"
},
"matchingColumns": [
"Telegram(username)"
],
"schema": [
{
"id": "\u0406\u043c\u2019\u044f",
"displayName": "\u0406\u043c\u2019\u044f",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Telegram(username)",
"displayName": "Telegram(username)",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"displayName": "\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"displayName": "\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443",
"displayName": "\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)",
"displayName": "\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442",
"displayName": "\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "row_number",
"displayName": "row_number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "number",
"canBeUsedToMatch": true,
"readOnly": true,
"removed": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.6,
"position": [
-448,
-1360
],
"id": "744a890a-9559-45cb-8c99-0914952c7878",
"name": "Update row in sheet1",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"url": "https://api.calendly.com/users/me",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "calendlyApi",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-1824,
-1168
],
"id": "e0693bc0-4fe4-49de-a544-c95df9fbc7bd",
"name": "AuthCalendly",
"credentials": {
"calendlyApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "function toISOStringWithZ(date) {\n return date.toISOString().replace(/\\.\\d{3}Z$/, \"Z\");\n}\n\nconst now = new Date();\n\nconst tomorrow = new Date(Date.UTC(\n now.getUTCFullYear(),\n now.getUTCMonth(),\n now.getUTCDate() + 1,\n 0, 0, 0\n));\n\nconst endOfMonth = new Date(Date.UTC(\n tomorrow.getUTCFullYear(),\n tomorrow.getUTCMonth() + 1,\n 0,\n 23, 59, 59\n));\n\nconst eventType = \"https://api.calendly.com/event_types/725f54e0-06e5-482a-9659-5998f307b004\"; \nconst timezone = \"Europe/Kyiv\";\n\nconst url = `https://api.calendly.com/event_type_available_times?event_type=${encodeURIComponent(eventType)}&start_time=${toISOStringWithZ(tomorrow)}&end_time=${toISOStringWithZ(endOfMonth)}&timezone=${encodeURIComponent(timezone)}`;\n\nreturn [\n {\n json: {\n url,\n start_time: toISOStringWithZ(tomorrow),\n end_time: toISOStringWithZ(endOfMonth),\n timezone\n }\n }\n];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-1664,
-1168
],
"id": "e973d2db-11d5-46d5-94ec-77071f7c7423",
"name": "CreateLink"
},
{
"parameters": {
"url": "={{ $json.url }}",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "calendlyApi",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-1504,
-1168
],
"id": "20c59559-2269-480d-84b9-62f67690698e",
"name": "GetSlotsAll",
"credentials": {
"calendlyApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
"text": "=\u0412\u044b \u043e\u0431\u0440\u0430\u043b\u0438 \u0447\u0430\u0441 {{ $('Process & State').item.json.userDataToSave.name }}",
"replyMarkup": "replyKeyboardRemove",
"replyKeyboardRemove": {},
"additionalFields": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
-736,
-1184
],
"id": "fee26867-df76-4757-93ab-a3fc4bba2e04",
"name": "Send a text message2",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "update",
"documentId": {
"__rl": true,
"value": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit?usp=sharing",
"mode": "url"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "\u041b\u0438\u0441\u04421",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"Telegram(username)": "={{ $json.result.chat.username }}",
"\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456": "={{ $('Process & State').item.json.userDataToSave.name }}"
},
"matchingColumns": [
"Telegram(username)"
],
"schema": [
{
"id": "\u0406\u043c\u2019\u044f",
"displayName": "\u0406\u043c\u2019\u044f",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Telegram(username)",
"displayName": "Telegram(username)",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"displayName": "\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"displayName": "\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443",
"displayName": "\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)",
"displayName": "\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442",
"displayName": "\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "row_number",
"displayName": "row_number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "number",
"canBeUsedToMatch": true,
"readOnly": true,
"removed": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.6,
"position": [
-576,
-1184
],
"id": "c7d3bab3-6d71-413a-ad25-c2a3ea8131b1",
"name": "Update row in sheet2",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"documentId": {
"__rl": true,
"value": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit?usp=sharing",
"mode": "url"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "\u041b\u0438\u0441\u04421",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit#gid=0"
},
"options": {}
},
"id": "edf644a4-b450-42f1-a1f7-fd8ff90b1672",
"name": "Get Data from both spreadsheets",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
-400,
-1184
],
"alwaysOutputData": true,
"executeOnce": false,
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "update",
"documentId": {
"__rl": true,
"value": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit?usp=sharing",
"mode": "url"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "\u041b\u0438\u0441\u04421",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442": "\u0422\u0430\u043a",
"Telegram(username)": "={{ $('Telegram Trigger').item.json.message.chat.username }}"
},
"matchingColumns": [
"Telegram(username)"
],
"schema": [
{
"id": "\u0406\u043c\u2019\u044f",
"displayName": "\u0406\u043c\u2019\u044f",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "Telegram(username)",
"displayName": "Telegram(username)",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"displayName": "\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"displayName": "\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443",
"displayName": "\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)",
"displayName": "\u0427\u0438 \u0437\u0430\u043f\u043e\u0432\u043d\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430 (\u0442\u0430\u043a/\u043d\u0456)",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442",
"displayName": "\u0427\u0438 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043d\u043e \u0441\u043b\u043e\u0442",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "row_number",
"displayName": "row_number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "number",
"canBeUsedToMatch": true,
"readOnly": true,
"removed": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.6,
"position": [
-736,
-1008
],
"id": "bdc611ce-a7c1-49d7-a32a-f1e4235fbc71",
"name": "Update row in sheet3",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
"text": "=\ud83d\udd12 \u0412\u0430\u0448 \u0441\u043b\u043e\u0442 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e!\n\u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u044c\u0442\u0435 \u0431\u0440\u043e\u043d\u044c, \u043f\u0435\u0440\u0435\u0439\u0434\u0456\u0442\u044c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435:\n\ud83d\udc49 {{ $json.bookingLink }}",
"replyMarkup": "replyKeyboard",
"replyKeyboard": {
"rows": [
{
"row": {
"buttons": [
{
"text": "\u041f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0431\u0440\u043e\u043d\u044c",
"additionalFields": {}
}
]
}
}
]
},
"replyKeyboardOptions": {
"resize_keyboard": true
},
"additionalFields": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
-32,
-1184
],
"id": "5ada3a24-06f9-4f1a-a0d7-0803f26227d9",
"name": "Send a text message4",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "const allSlots = $('GetSlotsAll').first().json.collection;\n\nconst chatId =$('Telegram Trigger').first().json.message.chat.id;\n\nconst messageText = \"\u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u043e\u0431\u0435\u0440\u0456\u0442\u044c \u0437\u0440\u0443\u0447\u043d\u0438\u0439 \u0447\u0430\u0441:\";\n\nconst filteredSlotsForDate = allSlots.filter(slot =>\n slot.status === 'available' && slot.start_time.startsWith($('Process & State').first().json.userDataToSave.name)\n);\nconst keyboardButtons = filteredSlotsForDate.map(slot => {\n const dateObject = new Date(slot.start_time);\n \n const displayTime = dateObject.toLocaleTimeString('uk-UA', { \n hour: '2-digit', \n minute: '2-digit',\n timeZone: 'Europe/Kyiv' // \u0412\u0410\u0416\u041b\u0418\u0412\u041e: \u0432\u043a\u0430\u0436\u0456\u0442\u044c \u0432\u0430\u0448 \u0447\u0430\u0441\u043e\u0432\u0438\u0439 \u043f\u043e\u044f\u0441\n });\n\n return [displayTime]; \n});\n\nconst telegramRequestBody = {\n telegramBody: {\n chat_id: chatId,\n text: messageText,\n reply_markup: {\n keyboard: keyboardButtons, // \u041d\u0430\u0448 \u043c\u0430\u0441\u0438\u0432 \u043a\u043d\u043e\u043f\u043e\u043a\n one_time_keyboard: true, // \u041a\u043b\u0430\u0432\u0456\u0430\u0442\u0443\u0440\u0430 \u0437\u043d\u0438\u043a\u043d\u0435 \u043f\u0456\u0441\u043b\u044f \u043d\u0430\u0442\u0438\u0441\u043a\u0430\u043d\u043d\u044f\n resize_keyboard: true // \u041a\u043b\u0430\u0432\u0456\u0430\u0442\u0443\u0440\u0430 \u043f\u0456\u0434\u043b\u0430\u0448\u0442\u0443\u0454\u0442\u044c\u0441\u044f \u043f\u043e \u0432\u0438\u0441\u043e\u0442\u0456\n }\n }\n};\n\nreturn telegramRequestBody;"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-736,
-1360
],
"id": "5fbbb4d7-4a66-4ca4-96d4-40d124968703",
"name": "ChooseDataMeeting"
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
"text": "=\u0414\u044f\u043a\u0443\u044e \u0437\u0430 \u043f\u0456\u0434\u0442\u0432\u0435\u0440\u0436\u0435\u043d\u043d\u044f!\n\u042f \u043d\u0430\u0433\u0430\u0434\u0430\u044e \u0442\u043e\u0431\u0456 \u043f\u0440\u043e \u0437\u0443\u0441\u0442\u0440\u0456\u0447 \u0437\u0430 1 \u0433\u043e\u0434\u0438\u043d\u0443 \u0442\u0430 \u0437\u0430 10 \u0445\u0432\u0438\u043b\u0438\u043d \u0434\u043e \u043d\u0435\u0457!",
"replyMarkup": "replyKeyboardRemove",
"replyKeyboardRemove": {
"remove_keyboard": true
},
"additionalFields": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
-560,
-1008
],
"id": "5c0b5189-b0ab-450d-baff-6c40bf8b6d99",
"name": "Send a text message3",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resume": "specificTime",
"dateTime": "={{ $json.remind1h }}"
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
-64,
-1008
],
"id": "0194be84-a223-4c68-b94b-164450b96267",
"name": "Wait"
},
{
"parameters": {
"documentId": {
"__rl": true,
"value": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit?usp=sharing",
"mode": "url"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "\u041b\u0438\u0441\u04421",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1JyWcrw3pAp6WCxH1h-IU6K7P4e5RPU364ziWpEA9g74/edit#gid=0"
},
"options": {}
},
"id": "42063df3-2441-4583-87d0-7356e3429755",
"name": "Get Data from both spreadsheets1",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
-384,
-1008
],
"alwaysOutputData": true,
"executeOnce": false,
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "const date = $input.first().json['\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456']; \nconst time = $input.first().json['\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456']; \n\nconst [year, month, day] = date.split('-').map(Number);\nconst [hours, minutes] = time.split(':').map(Number);\n\nconst meetingDate = new Date(year, month - 1, day, hours, minutes);\n\nconst remind1h = new Date(meetingDate.getTime() - 60 * 60 * 1000);\nconst remind10min = new Date(meetingDate.getTime() - 10 * 60 * 1000);\n\nfunction toLocalISOString(date) {\n return date.getFullYear() + '-' +\n String(date.getMonth() + 1).padStart(2, '0') + '-' +\n String(date.getDate()).padStart(2, '0') + 'T' +\n String(date.getHours()).padStart(2, '0') + ':' +\n String(date.getMinutes()).padStart(2, '0') + ':' +\n String(date.getSeconds()).padStart(2, '0');\n}\n\nreturn [\n {\n json: {\n original: `${date}T${time}:00`,\n remind1h: toLocalISOString(remind1h),\n remind10min: toLocalISOString(remind10min),\n forWaitUntil: toLocalISOString(meetingDate)\n }\n }\n];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-224,
-1008
],
"id": "4376d802-3c72-4d84-81e1-d9db6061d6d2",
"name": "TimeCalculation"
},
{
"parameters": {
"jsCode": "// \u041e\u0442\u0440\u0438\u043c\u0443\u0454\u043c\u043e username \u0437 Telegram Trigger\nconst targetUser = $('Telegram Trigger').first().json.message.from.username;\n\n// \u041e\u0442\u0440\u0438\u043c\u0443\u0454\u043c\u043e \u0432\u0441\u0456 \u0437\u0430\u043f\u0438\u0441\u0438 \u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u0456\nconst items = $input.all();\n\n// \u0417\u043d\u0430\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0438\u0439 \u0440\u044f\u0434\u043e\u043a \u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0456 \u043f\u043e Telegram(username)\nconst match = items.find(item => item.json['Telegram(username)'] === targetUser);\n\nif (!match) {\n throw new Error(`\u041d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0434\u0430\u043d\u0456 \u0434\u043b\u044f \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0430 @${targetUser}`);\n}\n\n// \u0411\u0435\u0440\u0435\u043c\u043e \u0434\u0430\u0442\u0443 \u0456 \u0447\u0430\u0441 \u0456\u0437 \u0446\u044c\u043e\u0433\u043e \u0440\u044f\u0434\u043a\u0430\nconst date = match.json['\u0414\u0430\u0442\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456'];\nconst time = match.json['\u0427\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456'] + \":00\";\n\n// \u0421\u0442\u0432\u043e\u0440\u044e\u0454\u043c\u043e \u0434\u0430\u0442\u0443 \u0443 \u0444\u043e\u0440\u043c\u0430\u0442\u0456 ISO\nconst startTime = `${date}T${time}Z`;\nconst month = date.slice(0, 7);\n\n// \u0422\u0438\u043f \u043f\u043e\u0434\u0456\u0457\nconst eventTypeSlug = \"30min\";\n\n// \u0421\u0442\u0432\u043e\u0440\u044e\u0454\u043c\u043e \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0431\u0440\u043e\u043d\u044e\u0432\u0430\u043d\u043d\u044f\nconst bookingLink = `https://calendly.com/ai-diagnostics-for-business/${eventTypeSlug}?invitee_start_time=${encodeURIComponent(startTime)}&month=${month}&date=${date}`;\n\nreturn [\n {\n json: {\n \u042e\u0437\u0435\u0440: targetUser,\n bookingLink\n }\n }\n];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-224,
-1184
],
"id": "2171a847-03dc-4f7e-a096-9e8a5370f3f1",
"name": "CreateLinkForUsers"
},
{
"parameters": {
"resume": "specificTime",
"dateTime": "={{ $('TimeCalculation').item.json.remind10min }}"
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
272,
-1008
],
"id": "e457692f-fa65-41b4-89e7-2d5281b68641",
"name": "Wait1"
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
"text": "=\u041d\u0430\u0433\u0430\u0434\u0443\u0454\u043c\u043e, \u0449\u043e \u0432\u0430\u0448\u0430 \u0437\u0443\u0441\u0442\u0440\u0456\u0447 \u0437\u0430\u043f\u043b\u0430\u043d\u043e\u0432\u0430\u043d\u0430. \n\u0417\u0430\u043b\u0438\u0448\u0438\u043b\u0430\u0441\u044f 1 \u0433\u043e\u0434\u0438\u043d\u0430!",
"replyMarkup": "replyKeyboardRemove",
"replyKeyboardRemove": {
"remove_keyboard": true
},
"additionalFields": {}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
96,
-1008
],
"id": "16774998-e776-4b2a-b4f7-5ac630149066",
"name": "Send a text message5",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
"text": "=\u0427\u0435\u0440\u0435\u0437 10 \u0445\u0432\u0438\u043b\u0438\u043d \u0443 \u0432\u0430\u0441 \u0437\u0443\u0441\u0442\u0440\u0456\u0447! \n\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0438\u0441\u044f.",
"replyMarkup": "replyKeyboardRemove",
"replyKeyboardRemove": {
"remove_keyboard": true
},
"additionalFields": {}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
448,
-1008
],
"id": "aefaf30f-5260-4a20-a0d1-f3630b6b76f0",
"name": "Send a text message6",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
}
],
"connections": {
"Process & State": {
"main": [
[
{
"node": "AuthCalendly",
"type": "main",
"index": 0
}
]
]
},
"Send Reply": {
"main": [
[]
]
},
"Append row in sheet": {
"main": [
[]
]
},
"Send a text message": {
"main": [
[
{
"node": "Append row in sheet",
"type": "main",
"index": 0
}
]
]
},
"If": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Reply",
"type": "main",
"index": 0
}
]
]
},
"Send a text message1": {
"main": [
[
{
"node": "Update row in sheet",
"type": "main",
"index": 0
}
]
]
},
"Update row in sheet": {
"main": [
[
{
"node": "MessageForPerson",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Process & State",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Send a text message1",
"type": "main",
"index": 0
}
],
[
{
"node": "Send a text message",
"type": "main",
"index": 0
}
],
[
{
"node": "ChooseDataMeeting",
"type": "main",
"index": 0
}
],
[
{
"node": "Send a text message2",
"type": "main",
"index": 0
}
],
[
{
"node": "Update row in sheet3",
"type": "main",
"index": 0
}
]
]
},
"MessageForPerson": {
"main": [
[
{
"node": "CreateTelegramMessage1",
"type": "main",
"index": 0
}
]
]
},
"CreateTelegramMessage1": {
"main": [
[]
]
},
"CreateTelegramMessage": {
"main": [
[
{
"node": "Update row in sheet1",
"type": "main",
"index": 0
}
]
]
},
"AuthCalendly": {
"main": [
[
{
"node": "CreateLink",
"type": "main",
"index": 0
}
]
]
},
"CreateLink": {
"main": [
[
{
"node": "GetSlotsAll",
"type": "main",
"index": 0
}
]
]
},
"GetSlotsAll": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Send a text message2": {
"main": [
[
{
"node": "Update row in sheet2",
"type": "main",
"index": 0
}
]
]
},
"Update row in sheet2": {
"main": [
[
{
"node": "Get Data from both spreadsheets",
"type": "main",
"index": 0
}
]
]
},
"Get Data from both spreadsheets": {
"main": [
[
{
"node": "CreateLinkForUsers",
"type": "main",
"index": 0
}
]
]
},
"Update row in sheet3": {
"main": [
[
{
"node": "Send a text message3",
"type": "main",
"index": 0
}
]
]
},
"Send a text message4": {
"main": [
[]
]
},
"ChooseDataMeeting": {
"main": [
[
{
"node": "CreateTelegramMessage",
"type": "main",
"index": 0
}
]
]
},
"Send a text message3": {
"main": [
[
{
"node": "Get Data from both spreadsheets1",
"type": "main",
"index": 0
}
]
]
},
"Get Data from both spreadsheets1": {
"main": [
[
{
"node": "TimeCalculation",
"type": "main",
"index": 0
}
]
]
},
"CreateLinkForUsers": {
"main": [
[
{
"node": "Send a text message4",
"type": "main",
"index": 0
}
]
]
},
"TimeCalculation": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Send a text message5",
"type": "main",
"index": 0
}
]
]
},
"Send a text message5": {
"main": [
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
]
]
},
"Wait1": {
"main": [
[
{
"node": "Send a text message6",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "7801bd50-2b91-4b1a-bd56-4d6e6b2b861c",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "FulYXozovRmFVi1G",
"tags": []
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
calendlyApigoogleSheetsOAuth2ApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
TGBot. Uses telegram, googleSheets, telegramTrigger, httpRequest. Event-driven trigger; 30 nodes.
Source: https://github.com/6MrCrazy6/telegram-reminder-bot-n8n/blob/6b2a3c457441899ad0fd7327ca4f9a74ed1bcdd6/workflows/TGBot.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Try on any outfit virtually - right inside Telegram. A user sends a person photo, then a garment photo (captioned ), and the bot replies with an AI-generated try-on result image using a dedicated Virt
This n8n workflow enables Telegram users to interact with multiple AI models dynamically using #model_id commands. It also supports a /models command to list all available models. Each user has a dail
Send any URL to your Telegram bot and get an AI summary instantly.
A robust n8n workflow designed to enhance Telegram bot functionality for user management and broadcasting. It facilitates automatic support ticket creation, efficient user data storage in Redis, and a
Transform your digital payment business with a fully-featured Telegram bot that handles everything from product listings to transaction processing. Perfect for entrepreneurs looking to automate their