This workflow corresponds to n8n.io template #7769 — we link there as the canonical source.
This workflow follows the Agent → Gmail 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": "LWeI4t06OADfdYoz",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Restaurant Booking",
"tags": [],
"nodes": [
{
"id": "af714295-c04b-4b68-98db-a123452308d7",
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
1488,
-160
],
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"typeVersion": 1.1
},
{
"id": "4ef8cf94-d2a1-47a8-aae0-a58e7fb78304",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1552,
80
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "o3-mini",
"cachedResultName": "o3-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "5e90e50a-a117-4b0a-9d3c-ac3cbba33e55",
"name": "Auto-fixing Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
"position": [
1872,
80
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "e75fd499-09eb-49a5-b870-0c721cd61c68",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1888,
208
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini",
"cachedResultName": "gpt-4.1-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "7472d657-e3c3-44f9-a65e-fabe69e77569",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
2032,
208
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n\t\"is_pass_next\": \"boolean\",\n\t\"message\": \"string\"\n}"
},
"typeVersion": 1.2
},
{
"id": "e318100d-2d21-434c-b302-5ef3af6946cf",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
2192,
-144
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Booking",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b27f50ed-f26d-4310-b049-f0b38ca069f6",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.output.is_pass_next }}",
"rightValue": ""
}
]
},
"renameOutput": true
},
{
"outputKey": "Feedback",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "ca6f2ea1-9dd1-4e77-9935-c3dbeb872ee4",
"operator": {
"type": "boolean",
"operation": "false",
"singleValue": true
},
"leftValue": "={{ $json.output.is_pass_next }}",
"rightValue": ""
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "d13d1d42-481c-4b01-8643-95da76472fa7",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
2432,
-48
],
"parameters": {
"text": "={{ $('Information Gathering Agent').item.json.output.message }}",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"appendAttribution": false
}
},
"typeVersion": 1.2
},
{
"id": "26488b92-2e3e-45a9-aaf1-31b4d40693ed",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
2640,
-160
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "34357e62-87db-4d9c-a4ac-b8008c944821",
"name": "user_data",
"type": "string",
"value": "={{$('Switch').item.json.output.message}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "c49a6ac1-c489-40cb-900e-231bc8e99b31",
"name": "Google Calendar",
"type": "n8n-nodes-base.googleCalendar",
"position": [
3312,
-208
],
"parameters": {
"end": "={{ $json.output.calendar_event.end_time }}",
"start": "={{ $json.output.calendar_event.start_time }}",
"calendar": {
"__rl": true,
"mode": "list",
"value": "user@example.com",
"cachedResultName": "user@example.com"
},
"additionalFields": {
"color": "7",
"summary": "={{ $json.output.email.description }}",
"attendees": [
"={{ $json.output.email.to }}"
]
},
"useDefaultReminders": false
},
"typeVersion": 1.3
},
{
"id": "ce3691c5-80ea-41df-a7e8-ee636ec130c3",
"name": "Booking Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
2880,
-160
],
"parameters": {
"text": "=You are the Booking Agent for Gourmet Dining \u2013 A Fine Culinary Experience.\nYour job is to take finalized booking details from the Restaurant Agent, and:\n\nGenerate a Google Calendar event object with proper start and end time.\n\nGenerate a confirmation email, including:\n\nRecipient email address\n\nEmail subject line\n\nA professional and beautifully formatted HTML body\n\nInput from Restaurant Agent: {{ $('Edit Fields').item.json['user_data'] }}\n\n\u2705 Your OUTPUT must be in this structure:\n\n{\n \"calendar_event\": {\n \"start_time\": \"2025-05-10T14:00:00\",\n \"end_time\": \"2025-05-10T17:00:00\",\n \"name\": \"Sarah Johnson\"\n },\n \"email\": {\n \"to\": \"sarah@example.com\",\n \"subject\": \"Your Gourmet Dining Reservation Confirmation \ud83c\udf7d\ufe0f\",\n \"html_body\": \"<html>... (full email HTML below) ...</html>\", \n \"description\": \"Booking with Sarah\"\n },\n}\n\nEXAMPLE: \n<html>\n <body style=\"font-family: Arial, sans-serif; color: #333;\">\n <h2 style=\"color: #B22222;\">\ud83c\udf77 Gourmet Dining \u2013 Reservation Confirmed</h2>\n <p>Dear Sarah Johnson,</p>\n <p>We are delighted to confirm your dinner reservation with us!</p>\n <table style=\"margin-top: 15px; border-collapse: collapse;\">\n <tr>\n <td><strong>Date:</strong></td>\n <td>May 10, 2025</td>\n </tr>\n <tr>\n <td><strong>Time:</strong></td>\n <td>7:00 PM \u2013 9:00 PM</td>\n </tr>\n <tr>\n <td><strong>Guests:</strong></td>\n <td>4</td>\n </tr>\n <tr>\n <td><strong>Dining Preference:</strong></td>\n <td>Outdoor Terrace</td>\n </tr>\n <tr>\n <td><strong>Location:</strong></td>\n <td>45 Culinary Avenue, Foodie City</td>\n </tr>\n </table>\n <p style=\"margin-top: 15px;\">\ud83d\udcdd <strong>Special Notes:</strong> Anniversary dinner \u2013 vegetarian-friendly menu requested.</p>\n <p>We look forward to hosting you for an unforgettable dining experience. \u2728</p>\n <p style=\"margin-top: 25px;\">Warm regards,<br/>The Gourmet Dining Team</p>\n <hr style=\"margin-top: 30px;\">\n <p style=\"font-size: 12px;\">Questions? Contact us at <a href='mailto:reservations@gourmetdining.com'>reservations@gourmetdining.com</a> or call (555) 123-4567</p>\n </body>\n</html>\n\n\n\n\ud83e\udde0 Behavior Notes:\nUse standard duration for dining reservations:\n\nDefault = 2 hours (unless specified by the user).\n\nConvert duration into end_time accordingly.\n\nFormat time in ISO 8601 (RFC3339) for calendar integration.\n\nTime zone is assumed to be the Restaurant's local time : {{ $now }}",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.8
},
{
"id": "96759672-4f19-4840-9939-a7af5d329530",
"name": "OpenAI Chat Model2",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2848,
48
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini",
"cachedResultName": "gpt-4.1-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "3518b693-8176-4c5c-b5fa-90a283569369",
"name": "Structured Output Parser1",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
3040,
32
],
"parameters": {
"jsonSchemaExample": "{\n \"calendar_event\": {\n \"start_time\": \"2025-05-10T14:00:00\",\n \"end_time\": \"2025-05-10T17:00:00\",\n \"name\": \"Sarah Johnson\"\n },\n \"email\": {\n \"to\": \"user@example.com\",\n \"subject\": \"Your Relaxing SPA Booking Confirmation \u2013 Rejuvenate & Revive Package\",\n \"html_body\": \"<html>... (full email HTML below) ...</html>\",\n \"description\": \"Booking with Sarah\"\n }\n}\n"
},
"typeVersion": 1.2
},
{
"id": "5def71b8-821f-47cb-86f9-0bf5bab3e07c",
"name": "Telegram3",
"type": "n8n-nodes-base.telegram",
"position": [
3504,
0
],
"parameters": {
"text": "=\ud83c\udf7d\ufe0f Your table has been successfully booked! \ud83c\udf89\n\n\ud83d\udcc5 Please check your email for the confirmation \u2014 it includes your reservation details like date, time, and number of guests.\n\n\ud83e\udd42 We\u2019ve also saved your details in our system, so everything will be ready when you arrive.\n\nWe can\u2019t wait to welcome you to our Restaurant \u2014 where great food meets warm hospitality. \ud83c\udf1f\nFeel free to reach out if you have any questions. See you soon! \ud83d\ude0a",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"appendAttribution": false
}
},
"typeVersion": 1.2
},
{
"id": "6749c5b6-d78d-485d-9da5-92d1c5abb38e",
"name": "Telegram1",
"type": "n8n-nodes-base.telegram",
"position": [
2432,
-224
],
"parameters": {
"text": "Thank you for your confirmation! We have noted down your information. You will be getting confirmation mail soon. ",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"appendAttribution": false
}
},
"typeVersion": 1.2
},
{
"id": "b9c4cf6c-daf2-4fa8-ada9-3211082e52f7",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1712,
80
],
"parameters": {
"sessionKey": "={{ $json.message.chat.id }}",
"sessionIdType": "customKey",
"contextWindowLength": 15
},
"typeVersion": 1.3
},
{
"id": "3dea953b-bd2e-4d16-9a06-2e04f5ae9813",
"name": "Send a message",
"type": "n8n-nodes-base.gmail",
"position": [
3312,
-16
],
"parameters": {
"sendTo": "={{ $json.output.email.to }}",
"message": "={{ $json.output.email.html_body }}",
"options": {},
"subject": "={{ $json.output.email.subject }}"
},
"typeVersion": 2.1
},
{
"id": "c6e7eb84-ad73-4bf7-a5a9-ab176992d3ad",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
-560
],
"parameters": {
"width": 1180,
"height": 1120,
"content": "## Overview\n\n- This workflow is an **AI-powered Booking Assistant** that automates restaurant and event reservations through **Telegram**. It interacts with the user in natural conversation, collects booking details (guest count, preferences, date/time, and special requests), finalizes the draft, and confirms the reservation by storing it in **Google Calendar** and sending an **email confirmation** \u2014 fully automated end-to-end.\n\n---\n\n## How It Works\n\n### 1. User Interaction\n- The workflow starts with a Telegram welcome message. \n- The AI agent asks step-by-step questions: \n - Number of guests \n - Seating preference (indoor/outdoor/private room) \n - Special occasion requests (birthday, date, etc.) \n - Preferred date & time \n- Once details are gathered, it generates a draft booking summary.\n\n### 2. Confirmation & Personal Details\n- The user reviews the draft and confirms. \n- The assistant then asks for personal details (name, email, phone number).\n\n### 3. Booking & Notifications\n- After confirmation, the details are sent to **Google Calendar** to create an event. \n- A **confirmation email** is sent to the user with all booking information. \n- A final Telegram message confirms that the reservation is successfully completed.\n\n---\n\n## How to Use\n- Triggered directly from **Telegram Bot**. \n- Simply start chatting with the bot to begin the reservation process. \n- The assistant will guide the user step by step until the booking is finalized. \n- Once completed, the user receives both an **email confirmation** and a **Telegram confirmation** message.\n\n---\n\n## Requirements\nTo use this workflow, you\u2019ll need: \n- **n8n account** (self-hosted or cloud) \n- **Telegram Bot Token** (for chat interaction) \n- **OpenAI or OpenRouter API Key** (for AI-driven conversation) \n- **Google Calendar API access** (to create bookings) \n- **Gmail / SMTP credentials** (to send confirmation emails) \n"
},
"typeVersion": 1
},
{
"id": "97603895-e634-4357-b625-aa29c6e4de60",
"name": "Information Gathering Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1680,
-160
],
"parameters": {
"text": "=\ud83c\udf7d Restaurant Table Booking Prompt (Converted)\n\nYou are the Restaurant Reservation Agent for Gourmet Dining \u2013 A Fine Culinary Experience.\n\nYour role is to assist users in booking a table, starting with gathering their information, confirming the reservation, and ensuring it's added to the calendar and an email is sent.\n\nUser Input : {{ $json.message.text }}\n\n\ud83c\udfad Tone and Behavior:\n\nWarm, polite, and professional \u2014 like a fine-dining concierge.\n\nFriendly but efficient.\n\nAlways move the conversation step by step, and never skip ahead unless you\u2019re sure.\n\nNever generate menu suggestions or table options randomly \u2014 rely on user preferences and confirmations.\n\n\ud83e\uddfe FLOW STRUCTURE:\n\n1. FIRST INTERACTION (Warm Greeting)\nAlways start with a polite opening and ask how you can help.\n\n{\n \"is_pass_next\": false,\n \"message\": \"Welcome to Gourmet Dining \ud83c\udf77\u2728 A Fine Culinary Experience. How may I assist you today? Are you looking to reserve a table?\"\n}\n\n\n2. RESERVATION DETAILS (Step by Step Questions)\nAsk one question at a time in sequence:\n\nDining Preference (Indoor / Outdoor / Private Room)\n\nNumber of Guests\n\nSpecial Requests (birthday setup, dietary needs, anniversary, etc.)\n\nPreferred Date & Time\n\nExample response if still collecting info:\n\n{\n \"is_pass_next\": false,\n \"message\": \"Great choice! How many guests will be joining you?\"\n}\n\n\n3. PRE-CONFIRMATION: Reservation Draft\nOnce enough details are gathered, propose a draft for review.\n\n{\n \"is_pass_next\": false,\n \"message\": \"Here\u2019s your table reservation draft \ud83c\udf7d\ufe0f:\\n\\n\ud83d\uddd3 Date: [Insert Date & Time]\\n\ud83d\udc65 Guests: [Number of Guests]\\n\ud83c\udff7 Dining Preference: [Indoor/Outdoor/Private Room]\\n\ud83c\udf89 Special Notes: [If any]\\n\ud83d\udccd Location: 45 Culinary Avenue, Foodie City\\n\\nShall we finalize this?\"\n}\n\n\n4. GATHER PERSONAL DETAILS (After Confirmation)\nOnly after the user confirms the reservation draft, ask for full name, email, and phone number.\n\n{\n \"is_pass_next\": false,\n \"message\": \"Perfect! To complete your reservation, may I have your full name, email, and an optional contact number?\"\n}\n\n\n5. FINAL CONFIRMATION & PASS TO SYSTEM\nOnce user provides details, finalize booking and pass it to system:\n\n{\n \"is_pass_next\": true,\n \"message\": {\n \"customer_name\": \"[Name]\",\n \"email\": \"[Email]\",\n \"phone\": \"[Phone Number]\",\n \"reservation_date\": \"[YYYY-MM-DD]\",\n \"reservation_time\": \"[Time]\",\n \"guests\": \"[Number of Guests]\",\n \"dining_preference\": \"[Indoor/Outdoor/Private Room]\",\n \"special_notes\": \"[Any notes from user]\"\n }\n}\n\nTime zone is assumed to be the Restaurant's local time : {{ $now }}\n\n",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.8
},
{
"id": "20c02205-e3cf-4022-9c3b-c24896109811",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1408,
-416
],
"parameters": {
"color": 7,
"width": 740,
"height": 820,
"content": "### Telegram Trigger & AI Agent Flow\n\n- **Telegram Trigger** \u2192 Listens for new messages from the user on Telegram. \n- **AI Agent** \u2192 Processes the user\u2019s message, understands intent (e.g., booking, feedback, etc.), and replies in a conversational way. \n- **Memory & Parsers** \u2192 Help the AI remember context and structure the responses so the flow remains smooth. \n"
},
"typeVersion": 1
},
{
"id": "091a027d-804d-4870-8589-714c145e7954",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
2160,
-496
],
"parameters": {
"color": 7,
"width": 620,
"height": 820,
"content": "### Switch, Telegram & Edit Fields\n\n- **Switch Node** \u2192 Decides the flow based on user input. \n - If the user is making a **Booking**, the process continues toward reservation steps. \n - If the user is giving **Feedback**, it routes the conversation separately. \n\n- **Telegram Nodes** \u2192 Send appropriate responses back to the user on Telegram depending on the chosen path. \n\n- **Edit Fields** \u2192 Prepares and formats the booking details (guest count, preferences, date/time, etc.) before passing them to the next step in the workflow. \n"
},
"typeVersion": 1
},
{
"id": "fd4ea3ed-a423-47ac-ae37-34ef61711e7b",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
2800,
-496
],
"parameters": {
"color": 7,
"width": 920,
"height": 820,
"content": "### Booking Agent, Google Calendar, Gmail & Telegram\n\n- **Booking Agent** \u2192 Collects all finalized booking details from the user, organizes them, and prepares a structured summary. It also creates a formatted HTML template for the confirmation email and ensures the booking payload is properly structured. \n\n- **Google Calendar** \u2192 Automatically creates a reservation event with the provided details (guest count, preferences, date/time, special requests). \n\n- **Send a Message (Gmail)** \u2192 Sends a professional confirmation email to the user with all booking details included. \n\n- **Telegram (Final Confirmation)** \u2192 Notifies the user on Telegram that their reservation has been successfully booked, completing the process end-to-end. \n"
},
"typeVersion": 1
}
],
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "0f830e29-e8d4-4461-a03e-f9f474eb6bad",
"connections": {
"Switch": {
"main": [
[
{
"node": "Telegram1",
"type": "main",
"index": 0
}
],
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"Telegram1": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Booking Agent",
"type": "main",
"index": 0
}
]
]
},
"Booking Agent": {
"main": [
[
{
"node": "Google Calendar",
"type": "main",
"index": 0
},
{
"node": "Send a message",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "Information Gathering Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Send a message": {
"main": [
[
{
"node": "Telegram3",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Information Gathering Agent",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Information Gathering Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Auto-fixing Output Parser",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model2": {
"ai_languageModel": [
[
{
"node": "Booking Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Auto-fixing Output Parser",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Auto-fixing Output Parser": {
"ai_outputParser": [
[
{
"node": "Information Gathering Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Structured Output Parser1": {
"ai_outputParser": [
[
{
"node": "Booking Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Information Gathering Agent": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow is an AI-powered Booking Assistant that automates restaurant and event reservations through Telegram. It interacts with the user in natural conversation, collects booking details (guest count, preferences, date/time, and special requests), finalizes the draft, and…
Source: https://n8n.io/workflows/7769/ — 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.
BoomerBobBot.TP. Uses agent, telegramTrigger, telegram, memoryBufferWindow. Event-driven trigger; 95 nodes.
Digital marketers, content creators, social media managers, and businesses who want to use AI marketing automation for YouTube Shorts without spending hours on production. This AI workflow helps anyon
Unlock the Power of Language with Personalized AI Learning! MOTION TUTOR is a revolutionary AI-powered language learning platform that adapts to your progress and guides you from basic vocabulary to c
Automate your personal productivity with this intelligent n8n workflow that integrates Telegram, Google Sheets, and OpenAI (GPT-4o). This system uses multiple AI agents to manage work hours, tasks, fi
This automation is designed to help you generate AI-powered music tracks, cover art, and fully rendered music videos — all triggered from a simple Telegram chat and managed via Google Sheets.