This workflow corresponds to n8n.io template #8809 — we link there as the canonical source.
This workflow follows the Google Calendar → Google Sheets 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 →
{
"id": "5JULEkgK2wDftVHr",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "My workflow",
"tags": [],
"nodes": [
{
"id": "7d54054d-f2d6-43dc-a323-0ff3c9cf4811",
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-1600,
592
],
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "dca7347f-c874-42b4-bab9-0b4c86e7b54e",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
-1232,
544
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "3d67f2fa-ab68-4d63-92d5-98e39a74e654",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.message.text }}",
"rightValue": "/start"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "82403d8b-6194-41ab-a033-06c9d5f2491e",
"operator": {
"type": "string",
"operation": "startsWith"
},
"leftValue": "={{ $json.message.text }}",
"rightValue": "agendar "
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "882a2a60-bf83-4195-8347-3d3fcbc43dec",
"operator": {
"type": "string",
"operation": "startsWith"
},
"leftValue": "={{ $json.message.text }}",
"rightValue": "cancelar "
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "42e95cb5-de43-4724-bd5d-7521740b777d",
"operator": {
"type": "string",
"operation": "startsWith"
},
"leftValue": "={{ $json.message.text }}",
"rightValue": "citas "
}
]
}
}
]
},
"options": {
"fallbackOutput": "extra"
}
},
"typeVersion": 3.2
},
{
"id": "280a841b-1ba9-470a-9f4e-fdae5da9661d",
"name": "Code in JavaScript",
"type": "n8n-nodes-base.code",
"position": [
-736,
304
],
"parameters": {
"jsCode": "// Obtenemos los datos del mensaje como antes\nconst text = $input.first().json.message.text;\nconst parts = text.split(' ');\nconst date = parts[1];\nconst time = parts[2];\nconst name = parts.slice(3).join(' ');\n\n// 1. Define tu zona horaria para evitar errores\nconst zone = 'America/Guayaquil';\n\n// 2. Creamos un objeto de fecha REAL a partir del texto, especificando el formato y la zona horaria\nconst startDateTime = DateTime.fromFormat(`${date} ${time}`, 'yyyy-MM-dd HH:mm', { zone });\n\n// 3. Calculamos la hora de fin (1 hora despu\u00e9s) usando el objeto que creamos\nconst endDateTime = startDateTime.plus({ hours: 1 });\n\n// 4. Devolvemos los datos listos para Google Calendar en el formato que necesita (ISO)\nreturn {\n name: name,\n summary: `Cita para ${name} - Bot CIAP`,\n startDateTime: startDateTime.toISO(),\n endDateTime: endDateTime.toISO()\n};"
},
"typeVersion": 2
},
{
"id": "086bc82f-dddf-4f03-bebd-54bcaec07ca7",
"name": "Create an event",
"type": "n8n-nodes-base.googleCalendar",
"position": [
0,
0
],
"parameters": {
"end": "={{ $('Code in JavaScript').item.json.endDateTime }}",
"start": "={{ $('Code in JavaScript').item.json.startDateTime }}",
"calendar": {
"__rl": true,
"mode": "list",
"value": "user@example.com",
"cachedResultName": "Citas CIAP"
},
"remindersUi": {
"remindersValues": [
{
"method": "popup",
"minutes": 30
}
]
},
"additionalFields": {
"summary": "={{ $('Code in JavaScript').item.json.summary }}",
"attendees": [],
"description": "Cita CIAP agendada con Bot",
"conferenceDataUi": {
"conferenceDataValues": {
"conferenceSolution": "hangoutsMeet"
}
}
},
"useDefaultReminders": false
},
"credentials": {
"googleCalendarOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "fba969c8-56d9-4173-8b61-6bf08a24e20c",
"name": "Respuesta de Cita Agendada",
"type": "n8n-nodes-base.telegram",
"position": [
544,
0
],
"parameters": {
"text": "=\u00a1Tu cita ha sido agendada con \u00e9xito! \u2705\n\n\ud83d\udc64 *Nombre:* {{ $('Code in JavaScript').item.json.name }}\n\n\ud83d\udcc5 *Fecha y Hora:* {{ DateTime.fromISO($('Code in JavaScript').item.json.startDateTime).setLocale('es').toFormat(\"EEEE, dd 'de' MMMM 'de' yyyy 'a las' HH:mm\") }}\n\nRecibir\u00e1s un recordatorio. \u00a1Te esperamos!",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "6874d8cc-581a-4a48-8613-6f04e9dfd763",
"name": "Respuesta Bot Inicial",
"type": "n8n-nodes-base.telegram",
"position": [
-896,
-192
],
"parameters": {
"text": "\u00a1Hola! \ud83d\udc4b \u00a1Bienvenido/a al Asistente Virtual de Citas!\n\nEstoy aqu\u00ed para ayudarte a gestionar tus citas de forma r\u00e1pida y sencilla.\n\n**\ud83d\uddd3\ufe0f Para agendar una cita**\nUsa el siguiente formato exacto:\n`agendar AAAA-MM-DD HH:MM Tu Nombre Completo`\n\n*Ejemplo:*\n`agendar 2025-09-22 15:00 Ana Rodriguez`\n\n---\n\n**\u274c Para cancelar una cita existente**\nUsa el mismo formato que usaste para agendar:\n`cancelar AAAA-MM-DD HH:MM Tu Nombre Completo`\n\n*Ejemplo:*\n`cancelar 2025-09-22 15:00 Ana Rodriguez`\n\n---\n\n**\ud83d\udccb Para ver tus pr\u00f3ximas citas**\nSimplemente env\u00eda un mensaje con tu nombre:\n`citas Tu Nombre Completo`\n*Ejemplo: `citas Ana Rodriguez`*\n\nProcesar\u00e9 tu solicitud y te enviar\u00e9 una confirmaci\u00f3n al instante.\n\nUna vez que env\u00edes tu mensaje, procesar\u00e9 tu solicitud y te enviar\u00e9 una confirmaci\u00f3n.",
"chatId": "={{ $json.message.chat.id }}",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "ba6c34c1-e2d3-467a-9245-08919dc661d4",
"name": "Get many events",
"type": "n8n-nodes-base.googleCalendar",
"position": [
-464,
304
],
"parameters": {
"options": {},
"timeMax": "={{ $json.endDateTime }}",
"timeMin": "={{ $json.startDateTime }}",
"calendar": {
"__rl": true,
"mode": "list",
"value": "user@example.com",
"cachedResultName": "Citas CIAP"
},
"operation": "getAll",
"returnAll": true
},
"credentials": {
"googleCalendarOAuth2Api": {
"name": "<your credential>"
}
},
"notesInFlow": false,
"retryOnFail": false,
"typeVersion": 1.3,
"alwaysOutputData": true
},
{
"id": "b53a67b7-3c32-403c-a498-74084fbcbaf3",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
-240,
304
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e9199cc8-ccae-402f-9170-06d16542c4fa",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.isEmpty() }}",
"rightValue": 0
}
]
}
},
"typeVersion": 2.2
},
{
"id": "92ba97c4-45ae-44a5-a6f4-99e187db603e",
"name": "Respuesta Hora no disponible",
"type": "n8n-nodes-base.telegram",
"position": [
80,
320
],
"parameters": {
"text": "Lo siento, ese horario ya no est\u00e1 disponible.\n\n\ud83d\uddd3\ufe0f Por favor, intenta con otra fecha u hora.",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "7e7ae0c9-81f8-4372-bc55-9cefec839de7",
"name": "Agregar cita en Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
256,
0
],
"parameters": {
"columns": {
"value": {
"id": "={{ $json.id }}",
"Fecha ISO": "={{ $json.start.dateTime }}",
"Fecha y hora": "={{ DateTime.fromISO($('Code in JavaScript').item.json.startDateTime).setLocale('es').toFormat(\"EEEE, dd 'de' MMMM 'de' yyyy 'a las' HH:mm\") }}",
"Nombre Cliente": "={{ $('Code in JavaScript').item.json.name }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "id",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "Nombre Cliente",
"type": "string",
"display": true,
"required": false,
"displayName": "Nombre Cliente",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Fecha y hora",
"type": "string",
"display": true,
"required": false,
"displayName": "Fecha y hora",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Fecha ISO",
"type": "string",
"display": true,
"required": false,
"displayName": "Fecha ISO",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM/edit#gid=0",
"cachedResultName": "Hoja 1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM/edit?usp=drivesdk",
"cachedResultName": "Citas Agendadas"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "1f56c7fd-e275-42a9-93cf-583651a8d965",
"name": "Respuesta Bot Defecto",
"type": "n8n-nodes-base.telegram",
"position": [
-976,
1392
],
"parameters": {
"text": "\ud83e\udd14 No entend\u00ed tu mensaje.\n\nRecuerda los comandos disponibles:\n\n\u2022 Env\u00eda /start para ver el mensaje de bienvenida.\n\u2022 Para agendar una cita, usa el formato:\n`agendar AAAA-MM-DD HH:MM Tu Nombre Completo`",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "d07fad71-b4f5-43b0-87b4-5abe0f2b13e0",
"name": "Code in JavaScript1",
"type": "n8n-nodes-base.code",
"position": [
-720,
720
],
"parameters": {
"jsCode": "// Obtenemos los datos del mensaje\nconst text = $input.first().json.message.text;\nconst parts = text.split(' ');\nconst date = parts[1];\nconst time = parts[2];\nconst name = parts.slice(3).join(' ');\n\n// Define tu zona horaria\nconst zone = 'America/Guayaquil'; // Aseg\u00farate que sea la correcta\n\n// Creamos el objeto de fecha para buscar\nconst startDateTime = DateTime.fromFormat(`${date} ${time}`, 'yyyy-MM-dd HH:mm', { zone });\n\n// 3. Calculamos la hora de fin (1 hora despu\u00e9s) usando el objeto que creamos\nconst endDateTime = startDateTime.plus({ hours: 1 });\n\n// Devolvemos los datos necesarios para la b\u00fasqueda\nreturn {\n name: name,\n summary: `Cita para ${name}`, // El t\u00edtulo exacto que debe buscar\n startDateTime: startDateTime.toISO(),\n endDateTime: endDateTime.toISO()\n};"
},
"typeVersion": 2
},
{
"id": "9e01f0c5-68b1-44e7-b056-85b8576e6f84",
"name": "Get many events1",
"type": "n8n-nodes-base.googleCalendar",
"position": [
-464,
720
],
"parameters": {
"options": {},
"timeMax": "={{ $json.endDateTime }}",
"timeMin": "={{ $json.startDateTime }}",
"calendar": {
"__rl": true,
"mode": "list",
"value": "user@example.com",
"cachedResultName": "Citas CIAP"
},
"operation": "getAll",
"returnAll": true
},
"credentials": {
"googleCalendarOAuth2Api": {
"name": "<your credential>"
}
},
"notesInFlow": false,
"retryOnFail": false,
"typeVersion": 1.3,
"alwaysOutputData": true
},
{
"id": "6a2d5552-a1fa-449a-ac3d-e6fb8d4f498b",
"name": "If1",
"type": "n8n-nodes-base.if",
"position": [
-240,
720
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "61e695f8-6364-4e01-9456-ee5937b41cc5",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.isEmpty() }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "6da89bc2-2a60-4a00-87a9-026a59e9d3c8",
"name": "Delete an event",
"type": "n8n-nodes-base.googleCalendar",
"position": [
208,
848
],
"parameters": {
"eventId": "={{ $json.id }}",
"options": {},
"calendar": {
"__rl": true,
"mode": "list",
"value": "user@example.com",
"cachedResultName": "Citas CIAP"
},
"operation": "delete"
},
"credentials": {
"googleCalendarOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "73d74b1e-9a18-49ef-abb9-d6191c892145",
"name": "Delete rows or columns from sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
768,
848
],
"parameters": {
"operation": "delete",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM/edit#gid=0",
"cachedResultName": "Hoja 1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM/edit?usp=drivesdk",
"cachedResultName": "Citas Agendadas"
},
"startIndex": "={{ $json.row_number }}"
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "bcc018ce-5b16-4caf-b27c-96ca2aa02d36",
"name": "Respuesta Cita Cancelada",
"type": "n8n-nodes-base.telegram",
"position": [
1056,
848
],
"parameters": {
"text": "\u2705 \u00a1Tu cita ha sido cancelada con \u00e9xito!",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "09c000de-845b-4891-8a1d-6067a60a607b",
"name": "Respuesta Cita no encontrada",
"type": "n8n-nodes-base.telegram",
"position": [
208,
560
],
"parameters": {
"text": "\u274c No se encontr\u00f3 ninguna cita agendada con esos datos. Por favor, verifica la fecha, hora y nombre.",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "75a7d2a8-dfba-4a6d-a596-ffb4a86cf2ad",
"name": "Code in JavaScript2",
"type": "n8n-nodes-base.code",
"position": [
-688,
1168
],
"parameters": {
"jsCode": "const text = $input.first().json.message.text;\n\n// \"citas\" es la 0, el nombre empieza en la 1\nconst name = text.split(' ').slice(1).join(' '); \n\n// Preparamos el t\u00e9rmino de b\u00fasqueda exacto para el t\u00edtulo del evento\nconst searchTerm = `Cita para ${name}`;\n\nreturn {\n name: name,\n searchTerm: searchTerm\n};"
},
"typeVersion": 2
},
{
"id": "1e9e9e69-843f-43a7-b255-14e71accac05",
"name": "Buscar cita agendada",
"type": "n8n-nodes-base.googleSheets",
"position": [
512,
848
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $('If1').item.json.id }}",
"lookupColumn": "id"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM/edit#gid=0",
"cachedResultName": "Hoja 1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM/edit?usp=drivesdk",
"cachedResultName": "Citas Agendadas"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "0b205172-0b74-4743-bf06-b28dafee3c93",
"name": "Buscar citas de cliente",
"type": "n8n-nodes-base.googleSheets",
"position": [
-448,
1168
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $json.name }}",
"lookupColumn": "Nombre Cliente"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM/edit#gid=0",
"cachedResultName": "Hoja 1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zDo2juIh2YkYZx1erqdhu5y5WC43iM0GV8LpMqov3UM/edit?usp=drivesdk",
"cachedResultName": "Citas Agendadas"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7,
"alwaysOutputData": true
},
{
"id": "184d70ba-ad50-4f61-8f8c-286e0d387138",
"name": "If2",
"type": "n8n-nodes-base.if",
"position": [
-176,
1232
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "62047214-0958-4dcb-9b5f-0ccc359ba9de",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.isEmpty() }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "71052b88-b00e-49dd-a6a1-b78e7d3016ff",
"name": "Respuesta Citas no encontradas",
"type": "n8n-nodes-base.telegram",
"position": [
192,
1088
],
"parameters": {
"text": "=\ud83e\udd14 No encontr\u00e9 ninguna cita futura agendada para {{ $('Code in JavaScript2').item.json.name }}. ",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "deb3937c-cda4-45e1-b633-5b1017b9e88d",
"name": "Code in JavaScript3",
"type": "n8n-nodes-base.code",
"position": [
192,
1328
],
"parameters": {
"jsCode": "// 1. Recibe los datos que vienen del nodo IF.\n// Ya sabemos que no vienen vac\u00edos, as\u00ed que los procesamos directamente.\nconst citas = $items().map(item => item.json);\n\n// 2. Obtenemos la fecha y hora actual para comparar.\nconst ahora = DateTime.now();\n\n// 3. Filtramos para quedarnos solo con las citas futuras.\nconst citasFuturas = citas.filter(cita => {\n // Convertimos la \"Fecha ISO\" de la hoja de c\u00e1lculo a un objeto de fecha real.\n const fechaCita = DateTime.fromISO(cita[\"Fecha ISO\"]);\n // Devolvemos 'true' solo si la fecha de la cita es posterior a ahora.\n return fechaCita > ahora;\n});\n\n// 4. Verificamos si, despu\u00e9s de filtrar, nos quedamos sin citas.\nif (citasFuturas.length === 0) {\n // Tomamos el nombre del cliente de los datos originales para el mensaje.\n const nombreCliente = citas[0][\"Nombre Cliente\"];\n return {\n message: `Hola, ${nombreCliente}. \ud83d\udc4b Veo que tienes citas registradas en nuestro sistema, pero ninguna ser\u00e1 en los pr\u00f3ximos d\u00edas.`\n };\n}\n\n// 5. Si S\u00cd hay citas futuras, construimos el mensaje de respuesta.\nconst nombreCliente = citasFuturas[0][\"Nombre Cliente\"];\nlet mensaje = `\u00a1Hola, ${nombreCliente}! \ud83d\udc4b Aqu\u00ed tienes un resumen de tus pr\u00f3ximas citas:\\n\\n`;\n\nfor (const cita of citasFuturas) {\n // Usamos la columna \"Fecha y hora\" que ya tiene el formato amigable.\n mensaje += `\ud83d\uddd3\ufe0f ${cita[\"Fecha y hora\"]}\\n`;\n}\n\n// Devolvemos el mensaje final listo para ser enviado.\nreturn {\n message: mensaje\n};"
},
"typeVersion": 2
},
{
"id": "c86aa958-6808-4d95-8d5b-e43bd07a0397",
"name": "Respuesta de Cita Agendada1",
"type": "n8n-nodes-base.telegram",
"position": [
464,
1328
],
"parameters": {
"text": "={{ $json.message }}",
"chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "81359378-4b13-4f3b-9692-fd48f6526a21",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1936,
592
],
"parameters": {
"color": 4,
"width": 256,
"height": 128,
"content": "## Start Point \nTelegram Trigger to listen the new messages from the users"
},
"typeVersion": 1
},
{
"id": "5466fa3f-0fc3-4e7e-9129-e53b5e519b75",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1392,
384
],
"parameters": {
"color": 5,
"width": 256,
"height": 128,
"content": "## Commands Options \n**Switch** for control the command send for the user (/help, agendar, cancelar, citas)"
},
"typeVersion": 1
},
{
"id": "fb9456e4-6fd4-4c61-b34d-74c6d703542e",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-688,
-192
],
"parameters": {
"width": 208,
"height": 112,
"content": "## Help Response\nInformation about the Bot's functions"
},
"typeVersion": 1
},
{
"id": "adecfb45-5b06-4617-9452-daff282c63d5",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-656,
112
],
"parameters": {
"color": 4,
"width": 464,
"height": 112,
"content": "## \"Agendar\" Module \nFlow to schedule a appointment with Telegram Bot and register on Google Calendar and Google Sheets"
},
"typeVersion": 1
},
{
"id": "de5e987a-fb6d-4c10-8c4b-4752e904e9ac",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-624,
560
],
"parameters": {
"color": 3,
"width": 464,
"height": 112,
"content": "## \"Cancelar\" Module \nFlow to cancel a appointment with Telegram Bot and register this change deleting on Google Calendar and Google Sheets"
},
"typeVersion": 1
},
{
"id": "204d8550-367a-49fc-a171-b64b62542033",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-592,
1040
],
"parameters": {
"color": 2,
"width": 464,
"height": 80,
"content": "## \"Citas\" Module \nFlow to check all the appointments from a user"
},
"typeVersion": 1
},
{
"id": "3d2d5f40-d8ef-4610-b0fa-33fb9c86896e",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-768,
1424
],
"parameters": {
"color": 2,
"width": 320,
"height": 96,
"content": "## Default Response \nBot's Response for unexpected messages"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "70c8a269-0a1c-4f37-9ecd-df60620f10db",
"connections": {
"If": {
"main": [
[
{
"node": "Create an event",
"type": "main",
"index": 0
}
],
[
{
"node": "Respuesta Hora no disponible",
"type": "main",
"index": 0
}
]
]
},
"If1": {
"main": [
[
{
"node": "Respuesta Cita no encontrada",
"type": "main",
"index": 0
}
],
[
{
"node": "Delete an event",
"type": "main",
"index": 0
}
]
]
},
"If2": {
"main": [
[
{
"node": "Respuesta Citas no encontradas",
"type": "main",
"index": 0
}
],
[
{
"node": "Code in JavaScript3",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Respuesta Bot Inicial",
"type": "main",
"index": 0
}
],
[
{
"node": "Code in JavaScript",
"type": "main",
"index": 0
}
],
[
{
"node": "Code in JavaScript1",
"type": "main",
"index": 0
}
],
[
{
"node": "Code in JavaScript2",
"type": "main",
"index": 0
}
],
[
{
"node": "Respuesta Bot Defecto",
"type": "main",
"index": 0
}
]
]
},
"Create an event": {
"main": [
[
{
"node": "Agregar cita en Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Delete an event": {
"main": [
[
{
"node": "Buscar cita agendada",
"type": "main",
"index": 0
}
]
]
},
"Get many events": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Get many events1": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript": {
"main": [
[
{
"node": "Get many events",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript1": {
"main": [
[
{
"node": "Get many events1",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript2": {
"main": [
[
{
"node": "Buscar citas de cliente",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript3": {
"main": [
[
{
"node": "Respuesta de Cita Agendada1",
"type": "main",
"index": 0
}
]
]
},
"Buscar cita agendada": {
"main": [
[
{
"node": "Delete rows or columns from sheet",
"type": "main",
"index": 0
}
]
]
},
"Buscar citas de cliente": {
"main": [
[
{
"node": "If2",
"type": "main",
"index": 0
}
]
]
},
"Agregar cita en Google Sheets": {
"main": [
[
{
"node": "Respuesta de Cita Agendada",
"type": "main",
"index": 0
}
]
]
},
"Delete rows or columns from sheet": {
"main": [
[
{
"node": "Respuesta Cita Cancelada",
"type": "main",
"index": 0
}
]
]
}
}
}
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.
googleCalendarOAuth2ApigoogleSheetsOAuth2ApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Tired of managing appointments manually? This template transforms your Telegram account into a smart virtual assistant that handles the entire scheduling process for you, 24/7.
Source: https://n8n.io/workflows/8809/ — 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
Manage employee attendance directly through Telegram with seamless Google Sheets integration. Employees can check in, check out, and view their daily attendance status from a Telegram bot. All records
TGBot. Uses telegram, googleSheets, telegramTrigger, httpRequest. Event-driven trigger; 30 nodes.
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
This n8n workflow lets users chat with GPT-5 directly in Telegram. It simulates typing for a natural UX, sends messages to GPT-5 via AI/ML API, and replies back in the same chat. Optionally, each inte