餐厅桌位预订
中级
这是一个Support Chatbot, Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 Agent, GoogleSheetsTool, ChatTrigger, LmChatOpenAi, ToolCalculator 等节点。 餐厅预订管理,使用OpenAI GPT和Google Sheets
前置要求
- •Google Sheets API 凭证
- •OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "YOUR_WORKFLOW_ID_HERE",
"meta": {
"instanceId": "YOUR_INSTANCE_ID_HERE",
"templateCredsSetupCompleted": true
},
"name": "餐厅桌位预订",
"tags": [
{
"id": "YOUR_TAG_ID_HERE",
"name": "Production",
"createdAt": "2025-06-22T07:40:05.501Z",
"updatedAt": "2025-06-22T07:40:05.501Z"
}
],
"nodes": [
{
"id": "e7a01c46-24ef-4bf7-b175-206280cf5de3",
"name": "当收到聊天消息时",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-320,
-336
],
"webhookId": "YOUR_WEBHOOK_ID_HERE",
"parameters": {
"public": true,
"options": {}
},
"typeVersion": 1.1
},
{
"id": "2b7ad3b3-c2d5-4311-bc39-23566331777e",
"name": "获取桌位信息",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
48,
112
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1179954207,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit#gid=1179954207",
"cachedResultName": "Tables"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID_HERE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit?usp=drivesdk",
"cachedResultName": "Restaurant Tables"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "YOUR_CREDENTIAL_ID_HERE",
"name": "YOUR_GOOGLE_SHEETS_CREDENTIAL_NAME"
}
},
"typeVersion": 4.6
},
{
"id": "63f786ad-cf09-40d2-b8bd-fccf53e5b6c9",
"name": "获取桌位可用性",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
208,
128
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit#gid=0",
"cachedResultName": "Availability"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID_HERE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit?usp=drivesdk",
"cachedResultName": "Restaurant Tables"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "YOUR_CREDENTIAL_ID_HERE",
"name": "YOUR_GOOGLE_SHEETS_CREDENTIAL_NAME"
}
},
"typeVersion": 4.6
},
{
"id": "3af75ca0-324c-4a6e-aa62-4f254d713c05",
"name": "获取桌位预订",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
384,
112
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1246645050,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit#gid=1246645050",
"cachedResultName": "Reservations"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID_HERE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit?usp=drivesdk",
"cachedResultName": "Restaurant Tables"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "YOUR_CREDENTIAL_ID_HERE",
"name": "YOUR_GOOGLE_SHEETS_CREDENTIAL_NAME"
}
},
"typeVersion": 4.6
},
{
"id": "8a522103-d056-4609-a0a8-a1b7982efde4",
"name": "简单记忆",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-304,
128
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "3911c46b-222e-4ada-915c-495c4e3d6b88",
"name": "更新预订",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
752,
128
],
"parameters": {
"columns": {
"value": {
"Notes": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Notes', ``, 'string') }}",
"Status": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Status', ``, 'string') }}",
"Contact": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Contact', ``, 'string') }}",
"Slot ID": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Slot_ID', ``, 'string') }}",
"Table ID": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Table_ID', ``, 'string') }}",
"Booked At": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Booked_At', ``, 'string') }}",
"Party Size": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Party_Size', ``, 'string') }}",
"Customer Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Customer_Name', ``, 'string') }}",
"Reservation ID": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Reservation_ID', ``, 'string') }}",
"Requested Features": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Requested_Features', ``, 'string') }}"
},
"schema": [
{
"id": "Reservation ID",
"type": "string",
"display": true,
"required": false,
"displayName": "Reservation ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Slot ID",
"type": "string",
"display": true,
"required": false,
"displayName": "Slot ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Table ID",
"type": "string",
"display": true,
"required": false,
"displayName": "Table ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Customer Name",
"type": "string",
"display": true,
"required": false,
"displayName": "Customer Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Contact",
"type": "string",
"display": true,
"required": false,
"displayName": "Contact",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Party Size",
"type": "string",
"display": true,
"required": false,
"displayName": "Party Size",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Booked At",
"type": "string",
"display": true,
"required": false,
"displayName": "Booked At",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Requested Features",
"type": "string",
"display": true,
"required": false,
"displayName": "Requested Features",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Notes",
"type": "string",
"display": true,
"required": false,
"displayName": "Notes",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1246645050,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit#gid=1246645050",
"cachedResultName": "Reservations"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID_HERE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit?usp=drivesdk",
"cachedResultName": "Restaurant Tables"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "YOUR_CREDENTIAL_ID_HERE",
"name": "YOUR_GOOGLE_SHEETS_CREDENTIAL_NAME"
}
},
"typeVersion": 4.6
},
{
"id": "ed1ab24b-9bd9-480b-9b8e-6706e201d79d",
"name": "取消预订",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
928,
128
],
"parameters": {
"operation": "delete",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1246645050,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit#gid=1246645050",
"cachedResultName": "Reservations"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID_HERE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit?usp=drivesdk",
"cachedResultName": "Restaurant Tables"
},
"startIndex": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start_Row_Number', ``, 'number') }}"
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "YOUR_CREDENTIAL_ID_HERE",
"name": "YOUR_GOOGLE_SHEETS_CREDENTIAL_NAME"
}
},
"typeVersion": 4.6
},
{
"id": "11799551-9859-44e4-baaf-86e00e053072",
"name": "OpenAI 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-496,
128
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "YOUR_OPENAI_CREDENTIAL_ID_HERE",
"name": "YOUR_OPENAI_CREDENTIAL_NAME"
}
},
"typeVersion": 1.2
},
{
"id": "2da71bb4-df59-4cae-b073-77483e42b4f0",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
128,
-336
],
"parameters": {
"options": {
"systemMessage": "=Role#\nYou are a professional and friendly AI assistant that helps customers make, modify, or cancel restaurant reservations through chat.\n\nYou interact with multiple tools connected to Google Sheets and a calculator to process requests accurately and reliably.\n\n---\n\nCurrent date and time: {{ $now }} \nUse this to:\n- Reject reservation requests for past times\n- Suggest time options like \"tonight,\" \"tomorrow,\" or \"this weekend\"\n- Record the timestamp when a reservation is made\n\n---\n\nTOOLS YOU HAVE ACCESS TO:\n\nData Lookup Tools:\n- Get Table Information → contains table features: capacity, smoking allowed, near window, outdoor, high chair, and notes\n- Get Table Availability → holds Slot ID, Date, Time, Table ID, Capacity, and Status (Available / Reserved)\n- Get Table Reservations → contains all reservation records with Reservation ID, Slot ID, Table ID, customer name, contact, etc.\n\nMemory Tool:\n- Simple Memory → remembers prior user messages for multi-turn conversations\n\nCalculation Tool:\n- Calculator → used only to calculate the next Reservation ID:\n - You must extract the highest Reservation ID from the Reservations sheet\n - Add +1 to get the next unique ID for the new booking\n\nWrite/Modify Tools:\n- Update Reservations → append a new reservation row using collected data\n- Update Table Availability → only update the status column of a slot with (Reserved or Available)\n- Cancel Reservations → delete a reservation row using name and contact\n\n---\n\nTASKS YOU CAN PERFORM\n\n1. Make a New Reservation\n\nAsk the user:\n- How many guests?\n- What date and time?\n- Any seating preferences? (e.g. smoking, near window, outdoor, high chair)\n\nThen:\n1. Search Table Information to filter tables based on preferences and capacity\n2. Cross-check Table Availability:\n - Match Date and Time\n - Table ID\n - Status must be Available\n3. Select a valid row and extract its **Slot ID** \n - Do not modify or increment Slot ID — always use as-is from the sheet\n\n4. Ask the user for their name and phone number\n\n5. Use the Calculator tool to:\n - Find the current maximum Reservation ID\n - Add +1 to get the new unique Reservation ID\n\n6. Use Update Reservations to append a new row with:\n - Reservation ID (from calculator)\n - Slot ID (from availability sheet)\n - Table ID\n - Customer name and contact\n - Party size\n - Status = Confirmed\n - Requested features (parsed from preferences)\n - Notes (if any)\n - Booked At = {{ $now }}\n\n7. Use Update Table Availability to mark the slot (by Slot ID) as Reserved\n\n8. Confirm the reservation to the user in a warm and clear message\n\n---\n\n2. Update an Existing Reservation\n\nIf the user wants to change their reservation:\n1. Ask for their name and phone number\n2. Use Get Table Reservations to find the matching row\n3. Ask what they want to change (e.g., time, guest count, seating)\n4. Search for a new slot using Table Availability (same logic as booking)\n - Extract the new Slot ID (do not generate one)\n5. Update the reservation row:\n - Use Update Reservations to modify Slot ID, time, table, preferences, etc.\n6. Update Table Availability:\n - Mark old Slot ID as Available\n - Mark new Slot ID as Reserved\n\n7. Confirm the updated details to the user\n\nIf no reservation is found:\n- Respond: \"I couldn't find a reservation under that name and contact. Could you double-check the details?\"\n\n---\n\n3. Cancel a Reservation\n\n1. Ask for the customer's name and phone number\n2. Use Get Table Reservations to find the matching row\n3. If found:\n - Use Cancel Reservations to remove the row\n - Use Update Table Availability to mark the associated Slot ID as Available\n\n4. Confirm the cancellation\n\nIf no match is found:\n- Say: \"I wasn't able to find a reservation with those details. Would you like me to try again?\"\n\n---\n\nBEHAVIOR GUIDELINES\n\n- Never allow bookings in the past (compare all requests with {{ $now }})\n- Always extract Slot ID from the Availability sheet — never generate or change it\n- Only increment Reservation ID using the Calculator tool\n- Always ensure that the same Slot ID used in Reservations is updated in Availability\n- Respond in a friendly, confident, and professional tone\n- Ask for missing info clearly and helpfully\n\n---\n\nEXAMPLE RESPONSES\n\n\"I've reserved Table E2 for 2 guests tonight at 8:00 PM. It's outdoor and near the window.\"\n\n\"Your reservation has been updated to 7:30 PM on Table A1.\"\n\n\"Your reservation for Sarah Khan at 8:00 PM has been cancelled. Hope to see you soon!\"\n\n---\n\nYou are Julian, the Reservation Concierge. Your job is to ensure seamless, accurate, and delightful bookings for all guests."
}
},
"typeVersion": 2.1
},
{
"id": "4eae5d6b-4888-47c7-92c2-d51a6d511102",
"name": "更新桌位可用性",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
576,
112
],
"parameters": {
"columns": {
"value": {
"Date": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Date', ``, 'string') }}",
"Time": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Time', ``, 'string') }}",
"Status": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Status', ``, 'string') }}",
"Slot ID": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Slot_ID__using_to_match_', ``, 'string') }}",
"Capacity": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Capacity', ``, 'string') }}",
"Table ID": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Table_ID', ``, 'string') }}"
},
"schema": [
{
"id": "Slot ID",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Slot ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Time",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Time",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Table ID",
"type": "string",
"display": true,
"required": false,
"displayName": "Table ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Capacity",
"type": "string",
"display": true,
"required": false,
"displayName": "Capacity",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Slot ID"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit#gid=0",
"cachedResultName": "Availability"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID_HERE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit?usp=drivesdk",
"cachedResultName": "Restaurant Tables"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "YOUR_CREDENTIAL_ID_HERE",
"name": "YOUR_GOOGLE_SHEETS_CREDENTIAL_NAME"
}
},
"typeVersion": 4.6
},
{
"id": "c4f398fd-1e25-48a2-b10c-3f25e10109e0",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
528,
-32
],
"parameters": {
"color": 4,
"width": 544,
"height": 272,
"content": "## 处理预订"
},
"typeVersion": 1
},
{
"id": "dcad74c6-58e3-4afb-94d8-4f4aebb1f99d",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
-32
],
"parameters": {
"width": 528,
"height": 336,
"content": "## 获取预订数据"
},
"typeVersion": 1
},
{
"id": "85393d5d-1084-42af-b0e0-dc00c0a50112",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-544,
-32
],
"parameters": {
"color": 5,
"width": 544,
"height": 272,
"content": "## AI"
},
"typeVersion": 1
},
{
"id": "042216f7-4cda-4967-b01b-e5a2f39824d2",
"name": "计算器",
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"position": [
-144,
128
],
"parameters": {},
"typeVersion": 1
},
{
"id": "014e0c2a-8720-4150-b385-65a029e8665e",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-544,
-416
],
"parameters": {
"color": 6,
"width": 1616,
"height": 384,
"content": "## 餐厅桌位预订AI助手"
},
"typeVersion": 1
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "YOUR_VERSION_ID_HERE",
"connections": {
"AI Agent": {
"main": [
[]
]
},
"Calculator": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Cancel Reservations": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Update Reservations": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get Table Availabilty": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get Table Information": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get Table Reservations": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Update Table Availabilty": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 客服机器人, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
基于AI的WhatsApp支持机器人(Google Sheets工单创建)
基于AI的WhatsApp支持机器人(Google Sheets工单创建)
Set
Xml
Code
+20
35 节点Zain Khan
客服机器人
AI医疗助手 - 多智能体演示系统
集成WhatsApp、GPT-4和Google Sheets的多智能体医疗助手
If
Set
Code
+13
52 节点Fakhar Khan
AI 聊天机器人
表格和计算器
使用GPT-4自然语言处理和计算器管理Google Sheets数据
Agent
Google Sheets Tool
Chat Trigger
+4
12 节点Yar Malik (Asfandyar)
AI 聊天机器人
使用 DeepSeek AI 和 Google Flights API 搜索和比较航班
使用 DeepSeek AI 和 Google Flights API 搜索和比较航班
Serp Api Tool
Agent
Chat Trigger
+2
5 节点Fakhar Khan
客服机器人
带 Zep 记忆的购物助手
使用Zep记忆、GPT-4和Google表格构建个性化购物助手
Agent
Google Sheets Tool
Memory Zep
+3
8 节点InfyOm Technologies
客服机器人
使用AI在WhatsApp和Google表格上自动化餐厅预订
使用AI在WhatsApp和Google表格上自动化餐厅预订
If
Filter
Whats App
+9
23 节点Basil Irfan
客服机器人
工作流信息
难度等级
中级
节点数量15
分类2
节点类型7
作者
Fakhar Khan
@fakharkhanAutomation expert specialized in n8n. I design and build AI-powered workflows that streamline operations, automate lead generation, and enhance customer engagement. Passionate about low-code automation and integrating tools like OpenAI, WhatsApp, Slack, and CRMs. Organizer of n8n events in Pakistan, helping businesses scale with smart, efficient automation systems.
外部链接
在 n8n.io 查看 →
分享此工作流