基于Gemini AI、WhatsApp、Stripe和Google Sheets的医生预约管理系统
高级
这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 43 个节点。主要使用 If, WhatsApp, HttpRequest, DateTimeTool, GoogleSheets 等节点。 基于Gemini AI、WhatsApp、Stripe和Google Sheets的医生预约管理系统
前置要求
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
- •Stripe API Key
- •Google Gemini API Key
使用的节点 (43)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "ae91f3a2c3e99a5233d018ffb5752bb637665a438dc075df08fe407535a29d75",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "8b252a0c-1ae3-4c3b-88b9-c9404c4800ac",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-944,
704
],
"parameters": {
"color": 3,
"width": 416,
"height": 272,
"content": "## 取消预订工作流。"
},
"typeVersion": 1
},
{
"id": "17530300-ece2-4b1a-9d88-3c3efbe72bca",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-944,
32
],
"parameters": {
"color": 4,
"width": 416,
"height": 192,
"content": "## 预约提醒工作流"
},
"typeVersion": 1
},
{
"id": "276adff9-24f2-4655-913f-bfeb2ce8742f",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-944,
1168
],
"parameters": {
"width": 416,
"height": 304,
"content": "## 支付验证工作流"
},
"typeVersion": 1
},
{
"id": "3fd7ed31-f2e7-47dd-96d7-d26f902c21fa",
"name": "Google Gemini 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-640,
2624
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "ee6c1218-d26b-4bec-8ae8-8dd2fbb2433c",
"name": "WhatsApp 触发器",
"type": "n8n-nodes-base.whatsAppTrigger",
"position": [
-864,
2272
],
"webhookId": "738b9902-7ae4-46df-bc73-6684d7d67bdf",
"parameters": {
"options": {},
"updates": [
"messages"
]
},
"typeVersion": 1
},
{
"id": "95cc9fe1-0599-47f5-b069-7e33e2aaf575",
"name": "简单记忆",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-640,
2800
],
"parameters": {
"sessionKey": "={{ $('WhatsApp Trigger').item.json.contacts[0].wa_id }}",
"sessionIdType": "customKey",
"contextWindowLength": 6
},
"typeVersion": 1.3
},
{
"id": "bd1defd2-b07e-4127-a704-cf91e7316441",
"name": "日期与时间",
"type": "n8n-nodes-base.dateTimeTool",
"position": [
-640,
2976
],
"parameters": {
"options": {
"timezone": "Asia/Kolkata"
}
},
"typeVersion": 2
},
{
"id": "958b5f9a-87fa-456c-a0b0-10f04950e27a",
"name": "发送消息",
"type": "n8n-nodes-base.whatsApp",
"position": [
448,
2272
],
"webhookId": "779c6e67-50cc-4757-9a96-14ab5cc1521f",
"parameters": {
"textBody": "={{ $json.output }}",
"operation": "send",
"additionalFields": {},
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.contacts[0].wa_id }}"
},
"typeVersion": 1
},
{
"id": "9f3e4761-a07d-4cf0-9816-723506851185",
"name": "获取用户的患者列表",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-448,
2832
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"typeVersion": 4.7
},
{
"id": "f8f6163b-e00e-448d-876a-6e6617551606",
"name": "添加患者",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-448,
2640
],
"parameters": {
"columns": {
"value": {
"age": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('age', ``, 'string') }}",
"name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('name', ``, 'string') }}",
"gender": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('gender', ``, 'string') }}",
"patient_id": "={{ $now.toMillis() }}",
"whatsapp_number": "={{ $('WhatsApp Trigger').item.json.contacts[0].wa_id }}"
},
"schema": [
{
"id": "patient_id",
"type": "string",
"display": true,
"required": false,
"displayName": "patient_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "whatsapp_number",
"type": "string",
"display": true,
"required": false,
"displayName": "whatsapp_number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "name",
"type": "string",
"display": true,
"required": false,
"displayName": "name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "age",
"type": "string",
"display": true,
"required": false,
"displayName": "age",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "gender",
"type": "string",
"display": true,
"required": false,
"displayName": "gender",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"typeVersion": 4.7
},
{
"id": "adfbc305-959c-4874-bf41-e6e4367900f3",
"name": "获取用户预约",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-272,
2832
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}",
"lookupColumn": "whatsapp_number"
}
]
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"typeVersion": 4.7
},
{
"id": "8da9ce69-2b4f-4415-98de-c30b810dfda0",
"name": "添加预约",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-272,
2640
],
"parameters": {
"columns": {
"value": {
"date": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('date', ``, 'string') }}",
"time": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('time', ``, 'string') }}",
"status": "Confirmed",
"patient_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('patient_id', ``, 'string') }}",
"appointment_id": "={{ $now.toMillis() }}",
"payment_method": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('payment_method', ``, 'string') }}",
"payment_status": "Pending",
"whatsapp_number": "={{ $('WhatsApp Trigger').item.json.contacts[0].wa_id }}"
},
"schema": [
{
"id": "appointment_id",
"type": "string",
"display": true,
"required": false,
"displayName": "appointment_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "patient_id",
"type": "string",
"display": true,
"required": false,
"displayName": "patient_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "whatsapp_number",
"type": "string",
"display": true,
"required": false,
"displayName": "whatsapp_number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "date",
"type": "string",
"display": true,
"required": false,
"displayName": "date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "time",
"type": "string",
"display": true,
"required": false,
"displayName": "time",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "payment_method",
"type": "string",
"display": true,
"required": false,
"displayName": "payment_method",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "payment_status",
"type": "string",
"display": true,
"required": false,
"displayName": "payment_status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "status",
"type": "string",
"display": true,
"required": false,
"displayName": "status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "stripe_payment_intent",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "stripe_payment_intent",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"typeVersion": 4.7
},
{
"id": "54ab2767-ca1b-4a34-98bb-3704e9ac7e6b",
"name": "获取所有预约",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-80,
2832
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "",
"cachedResultName": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"typeVersion": 4.7
},
{
"id": "8f2af0c9-5b67-4d92-8cbf-cc234b64ed4b",
"name": "AI 代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-336,
2272
],
"parameters": {
"text": "={{ $json.messages[0].text.body }}",
"options": {
"systemMessage": "You are an AI Assistant for a Doctor Clinic.\nYour role is to handle doctor’s appointment bookings via WhatsApp.\nYou must always keep track of the user’s progress with simple memory, and store/retrieve data in Google Sheets.\nPayments are handled via Stripe or Cash on Clinic.\nAlways be polite, WhatsApp-friendly, and guide users step by step.\n\nCore Workflow:\n\nGreeting & Main Menu\n\nWhen a user sends any message for the first time, greet them:\n\"Hello, Welcome to Doctor Clinic!\nPlease choose an option:\n\n1. New Booking\n2. My Upcoming Bookings\n3. Reschedule Booking\n4. Cancel Booking\"\n\nWait for the user’s choice.\n\nNew Booking Flow\n(a) Patient Lookup\n\nget user registered patients\n\nIf patients exist with , show patient list and ask which one to use.\n\nIf no patient exists for given WhatsApp number or user selects \"Add New Patient\":\n\nAsk for Name, Age, Gender.\n\nSave to Patients sheet.\n\nagain fetch the latest patient list for user \n\nShow updated patient list with patient_id ( must be displayed to user ), name, age and gender then ask which one to use ( user can reply with number option also ). \n\n(b) Date Selection\n\nGet the today's date and time from system\n\nGenerate 7 days (today + 6 days).\n\nExclude fully booked days.\n\nAsk user to choose a date.\n\n(c) Time Slot Selection\n\nFor chosen date, use working hours from Config sheet.\n\nDivide into slots of 60 minutes.\n\nExclude already booked slots for chosen date Using All Appointments sheet.\n\nExclude not_available slot using give date and time from config sheet in format YYYY-MM-DD HH:MM to HH:MM means on this date on given time range doctor will not be available.\n\nif todays date is chosen, Get the current time from system & show only the slots after the current system time ( ex. if current time is 12:05 then give option from 13:00).\n\nShow available slots and ask user to pick one.\n\n(d) Payment Options\n\nAfter time is selected, ask:\n\"How would you like to pay?\n\n1. Online (Stripe)\n2. Cash at Clinic\"\n\n(e) Confirmation Message\n\nAfter taking all the data add the appointment in appointment sheet if user selects online (stripe) then save payment_method \"Stripe\"\n\nand send confirm message with:\n\"Appointment booked!\nPatient: {name}\nDate: {date}\nTime: {time}\nPayment Method: {method}\nPayment Status: Not paid\nStatus: Confirmed\"\n\nMy Upcoming Bookings Flow\n\nGet the current date and time from system\n\nLook up all future user appointments.\nGet all user patients.\n\nshow them as a list with user name , booking date , booking time\n\nReschedule Flow\n\nLook up all future confirmed appointments for the user.\nGet all user patients.\n\nShow them as a list with appointment id, user name, appointment date & time.\n\nAsk which one to reschedule.\n\nGet the today's date and time from system\n\nGenerate 7 days (today + 6 days).\n\nExclude fully booked days.\n\nAsk user to choose a date.\n\nFor chosen date, use working hours from Config sheet.\n\nDivide into slots of 60 minutes.\n\nExclude already booked slots for chosen date Using All Appointments sheet.\n\nExclude not_available slot using give date and time from config sheet in format YYYY-MM-DD HH:MM to HH:MM means on this date on given time range doctor will not be available.\n\nif todays date is chosen, Get the current time from system & show only the slots after the current system time ( ex. if current time is 12:05 then give option from 13:00).\n\nShow available slots and ask user to pick one.\nafter the current system time ( if current time is 12:05 then give option from 13:00).\n\nShow available slots and ask user to pick one.\n\nafter picking one update the old appointment details with selected date and time \n\nand give a message to user that appointment has been reschedule and give details for new rescheduled appointment with patient details.\n\nCancel Flow\n\nGet the today's date and time from system\n\nLook up all future user appointments.\n\nShow them as a list with appointment id, appointment date & time .\n\nAsk which one to cancel.\n\nthen Cancel the selected appointment Appointment sheet.\n\nSend confirmation:\n\"Your appointment on {date} at {time} has been cancelled.\"\n\nGoogle Sheets Structure:\nPatients: patient_id, whatsapp_number, name, age, gender\nAppointments: appointment_id, patient_id, whatsapp_number, date, time, payment_method, payment_status, status, stripe_payment_intent\nConfig Sheet: key, value ( working_hours=10:00-18:00)\n\nMemory Rules:\n\nAlways remember where the user left off (menu, patient selection, date, time, payment).\n\nIf the user sends something invalid, say:\n\"Sorry, I didn’t understand that. Please reply with one of the given options.\"\n\nIf the user returns later, continue from the last remembered step.\n\nStyle Guide:\n\nsingle patient can register multiple patients and book as many appointments.\n\nKeep messages short, clear, and WhatsApp-friendly.\n\nUse numbers for options ( like reply with 1, 2, 3 ).\n\nAlways confirm before finalizing."
},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "895a58ff-a97e-48c2-8c94-4beb1ed6dd71",
"name": "重新安排预约",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-80,
2640
],
"parameters": {
"columns": {
"value": {
"date": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('date', ``, 'string') }}",
"time": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('time', ``, 'string') }}",
"appointment_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('appointment_id__using_to_match_', ``, 'string') }}"
},
"schema": [
{
"id": "appointment_id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "appointment_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "patient_id",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "patient_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "whatsapp_number",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "whatsapp_number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "date",
"type": "string",
"display": true,
"required": false,
"displayName": "date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "time",
"type": "string",
"display": true,
"required": false,
"displayName": "time",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "payment_method",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "payment_method",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "payment_status",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "payment_status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "status",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "stripe_payment_intent",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "stripe_payment_intent",
"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": [
"appointment_id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"typeVersion": 4.7
},
{
"id": "214abc48-d327-47ad-9d6a-df25af9c2622",
"name": "取消预约",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
112,
2640
],
"parameters": {
"columns": {
"value": {
"status": "Cancelled",
"appointment_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('appointment_id__using_to_match_', ``, 'string') }}"
},
"schema": [
{
"id": "appointment_id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "appointment_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "patient_id",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "patient_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "whatsapp_number",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "whatsapp_number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "date",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "time",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "time",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "payment_method",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "payment_method",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "payment_status",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "payment_status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "status",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "stripe_payment_intent",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "stripe_payment_intent",
"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": [
"appointment_id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"typeVersion": 4.7
},
{
"id": "934a9b4a-2760-416e-94fa-0200c208ec1d",
"name": "配置",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
112,
2832
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "",
"cachedResultName": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"typeVersion": 4.7
},
{
"id": "8533db59-6499-432b-ab50-f93a3007106d",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-928,
1632
],
"parameters": {
"color": 5,
"width": 416,
"height": 224,
"content": "## 支付链接生成"
},
"typeVersion": 1
},
{
"id": "43afc9b9-06f9-4794-a5d2-9b4e3407c7ad",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1376,
2096
],
"parameters": {
"color": 5,
"width": 444,
"height": 1016,
"content": "## 🚀 试试看:AI 驱动的 WhatsApp 预订助手"
},
"typeVersion": 1
},
{
"id": "5ebc144a-5b57-47ce-8a16-942dcb18d8f8",
"cid": "Ikx1Y2FzIFBleXJpbiI",
"name": "便签16",
"type": "n8n-nodes-base.stickyNote",
"notes": "© 2025 Lucas Peyrin",
"creator": "Lucas Peyrin",
"position": [
-496,
2592
],
"parameters": {
"color": 7,
"width": 756,
"height": 484,
"content": "此节点允许您的代理从 Google Sheets 创建和获取数据"
},
"typeVersion": 1
},
{
"id": "a204fc5a-6c63-4dea-94c4-59211a241ed4",
"cid": "Ikx1Y2FzIFBleXJpbiI",
"name": "便签13",
"type": "n8n-nodes-base.stickyNote",
"notes": "© 2025 Lucas Peyrin",
"creator": "Lucas Peyrin",
"position": [
-416,
2080
],
"parameters": {
"color": 7,
"width": 396,
"height": 380,
"content": "预约预订 AI 助手:"
},
"typeVersion": 1
},
{
"id": "d672a03d-ea19-4cd7-9f2a-6be41f2d072e",
"name": "设置说明",
"type": "n8n-nodes-base.stickyNote",
"position": [
-176,
-288
],
"parameters": {
"color": 7,
"width": 420,
"height": 524,
"content": "⚙️ **设置说明**:"
},
"typeVersion": 1
},
{
"id": "4d72c54d-078c-4187-bec2-16de2b0a82de",
"name": "计划触发器1",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-432,
64
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 8
}
]
}
},
"typeVersion": 1.2
},
{
"id": "e45f1771-70f9-4fee-9557-75fe44540233",
"name": "Google Gemini Chat Model3",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-240,
288
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "b058e4d9-12a5-42cb-8889-838386e3e7ad",
"name": "获取预约表格1",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-96,
288
],
"parameters": {
"options": {},
"sheetName": "YOUR_SHEET_TAB_ID_HERE",
"documentId": "YOUR_SPREADSHEET_ID_HERE"
},
"typeVersion": 4.7
},
{
"id": "df042b49-9570-440d-b066-f932238ae0ce",
"name": "日期和时间2",
"type": "n8n-nodes-base.dateTimeTool",
"position": [
32,
288
],
"parameters": {
"options": {
"timezone": "Asia/Kolkata"
}
},
"typeVersion": 2
},
{
"id": "b4c59b68-7a89-4b8f-8069-ad6b01efcbc6",
"name": "在 WhatsApp Business Cloud 中发送消息",
"type": "n8n-nodes-base.whatsAppTool",
"position": [
176,
288
],
"webhookId": "859580aa-af6e-45fe-9eb1-51226927e690",
"parameters": {
"textBody": "Hello {{ $json['Name'] }}, this is a reminder for your appointment scheduled today at {{ $json['Time'] }}.",
"operation": "send",
"additionalFields": {},
"recipientPhoneNumber": "YOUR_PHONE_NUMBER_HERE"
},
"typeVersion": 1
},
{
"id": "a6ae6d6a-0237-4257-8cfc-01780aa15a52",
"name": "预约提醒 AI 代理1",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-96,
64
],
"parameters": {
"text": "={{ $json['Readable date'] }}",
"options": {
"systemMessage": "You are an AI assistant responsible for sending WhatsApp reminders for scheduled appointments. Follow the steps below:\n\n1. Fetch appointments from the Google Sheet configured by the user.\n2. Get current date using the Date & Time node.\n3. Filter appointments where appointment date matches today and status is Pending or Confirmed.\n4. Send WhatsApp Reminder including recipient name, date, and time.\n\nExample:\nHello [Name], this is a reminder for your appointment scheduled today at [Time]."
},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "954a6a94-c847-4dfd-87d9-d05783bca0c9",
"name": "发送取消消息(现金)",
"type": "n8n-nodes-base.whatsApp",
"position": [
208,
848
],
"webhookId": "8093a666-5c89-4efd-8aee-7ce62869ae11",
"parameters": {
"textBody": "=Your Appointment {{ $('Google Sheets Trigger1').item.json.appointment_id }} is cancelled",
"operation": "send",
"phoneNumberId": "YOUR_WHATSAPP_PHONE_NUMBER_ID",
"additionalFields": {},
"recipientPhoneNumber": "={{ $('Google Sheets Trigger1').item.json.whatsapp_number.toString() }}"
},
"typeVersion": 1
},
{
"id": "9802e834-e47a-4f18-8ebb-aac088ec986a",
"name": "发送取消消息(STRIPE)",
"type": "n8n-nodes-base.whatsApp",
"position": [
432,
752
],
"webhookId": "b6d93991-c1e6-47e0-9edf-12579ce326dc",
"parameters": {
"textBody": "=Your Appointment {{ $('Google Sheets Trigger1').item.json.appointment_id }} is cancelled and the refund has been initiated",
"operation": "send",
"phoneNumberId": "YOUR_WHATSAPP_PHONE_NUMBER_ID",
"additionalFields": {},
"recipientPhoneNumber": "={{ $('Google Sheets Trigger1').item.json.whatsapp_number.toString() }}"
},
"typeVersion": 1
},
{
"id": "88a8d79b-8e8e-4481-af76-14fef00360b1",
"name": "Google Sheets 触发器1",
"type": "n8n-nodes-base.googleSheetsTrigger",
"position": [
-464,
752
],
"parameters": {
"event": "rowUpdate",
"options": {
"columnsToWatch": [
"status"
]
},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"sheetName": "YOUR_SHEET_TAB_ID_HERE",
"documentId": "YOUR_SPREADSHEET_ID_HERE"
},
"typeVersion": 1
},
{
"id": "7e4772c8-9bb6-4e46-af9b-fa134294aef1",
"name": "更新退款状态1",
"type": "n8n-nodes-base.googleSheets",
"position": [
432,
560
],
"parameters": {
"columns": {
"value": {
"appointment_id": "={{ $('Google Sheets Trigger1').item.json.appointment_id }}",
"payment_status": "Refunded"
},
"mappingMode": "defineBelow",
"matchingColumns": [
"appointment_id"
]
},
"options": {},
"operation": "update",
"sheetName": "YOUR_SHEET_TAB_ID_HERE",
"documentId": "YOUR_SPREADSHEET_ID_HERE"
},
"credentials": {},
"typeVersion": 4.7
},
{
"id": "94dd3375-6ece-4178-a8f5-62fdb25f7528",
"name": "Stripe 退款 API1",
"type": "n8n-nodes-base.httpRequest",
"position": [
208,
656
],
"parameters": {
"url": "https://api.stripe.com/v1/refunds",
"method": "POST",
"options": {},
"sendBody": true,
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "payment_intent",
"value": "={{ $('Google Sheets Trigger1').item.json.stripe_payment_intent }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_STRIPE_SECRET_KEY"
},
{
"name": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "9262e2f1-e96e-40aa-9598-af7049600500",
"name": "检查状态\"已取消\"1",
"type": "n8n-nodes-base.if",
"position": [
-240,
752
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "8b4c82d3-1d5d-43f3-9049-c2eb77d3c89d",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status.toLowerCase() }}",
"rightValue": "cancelled"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "22e0ad06-9f6a-478b-9c61-3065f26b231a",
"name": "检查是否已付款1",
"type": "n8n-nodes-base.if",
"position": [
-16,
752
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "3ca4b95f-158a-4800-8ca3-84b4ac99e9be",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $('Google Sheets Trigger1').item.json.stripe_payment_intent }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "bee37dc6-f91f-4b57-8012-f5ef4612ca54",
"name": "Stripe 触发器1",
"type": "n8n-nodes-base.stripeTrigger",
"position": [
-448,
1248
],
"webhookId": "YOUR_WEBHOOK_ID_HERE",
"parameters": {
"events": [
"payment_intent.succeeded"
]
},
"credentials": {},
"typeVersion": 1
},
{
"id": "cd3c9bb2-b134-45fc-a38a-378fb1a0510f",
"name": "发送支付确认1",
"type": "n8n-nodes-base.whatsApp",
"position": [
0,
1344
],
"webhookId": "YOUR_WEBHOOK_ID_HERE",
"parameters": {
"textBody": "=Your payment has been received for Appointment ID: [{{ $json.data[0].metadata.appointmentId }}]. \n\nThank you for booking your appointment with us! ",
"operation": "send",
"phoneNumberId": "YOUR_WHATSAPP_PHONE_NUMBER_ID",
"additionalFields": {},
"recipientPhoneNumber": "={{ $json.data[0].metadata.whatsappNo }}"
},
"typeVersion": 1
},
{
"id": "0010d0b6-b809-48bd-88c0-3d56dc302970",
"name": "检索支付会话1",
"type": "n8n-nodes-base.httpRequest",
"position": [
-224,
1248
],
"parameters": {
"url": "https://api.stripe.com/v1/checkout/sessions",
"options": {},
"sendBody": true,
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "payment_intent",
"value": "={{ $json.data.object.id }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_STRIPE_SECRET_KEY"
},
{
"name": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "677d9121-b6fb-47f9-a062-b3602ac26c5c",
"name": "标记为已支付1",
"type": "n8n-nodes-base.googleSheets",
"position": [
0,
1152
],
"parameters": {
"columns": {
"value": {
"status": "Confirmed",
"appointment_id": "={{ $json.data[0].metadata.appointmentId }}",
"payment_status": "Paid",
"stripe_payment_intent": "={{ $json.data[0].payment_intent }}"
},
"schema": [
{
"id": "appointment_id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "appointment_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "patient_id",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "patient_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "whatsapp_number",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "whatsapp_number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "date",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "time",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "time",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "payment_method",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "payment_method",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "payment_status",
"type": "string",
"display": true,
"required": false,
"displayName": "payment_status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "status",
"type": "string",
"display": true,
"required": false,
"displayName": "status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "stripe_payment_intent",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "stripe_payment_intent",
"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": [
"appointment_id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": "YOUR_SHEET_TAB_ID_HERE",
"documentId": "YOUR_SPREADSHEET_ID_HERE"
},
"credentials": {},
"typeVersion": 4.7
},
{
"id": "7e5acf7a-ee8b-479a-a90e-3deba22a1e74",
"name": "查找新预约1",
"type": "n8n-nodes-base.googleSheetsTrigger",
"position": [
-432,
1696
],
"parameters": {
"event": "rowAdded",
"options": {
"dateTimeRenderOption": "FORMATTED_STRING"
},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"sheetName": "YOUR_SHEET_TAB_ID_HERE",
"documentId": "YOUR_SPREADSHEET_ID_HERE"
},
"typeVersion": 1
},
{
"id": "3bc10bf6-fe54-4988-ae40-42ab565fd5c4",
"name": "发送支付链接1",
"type": "n8n-nodes-base.whatsApp",
"position": [
240,
1696
],
"webhookId": "YOUR_WEBHOOK_ID_HERE",
"parameters": {
"textBody": "=This is the link to pay for your appointment Id {{ $json.metadata.appointmentId }}\n\n{{ $json.url }}",
"operation": "send",
"phoneNumberId": "YOUR_WHATSAPP_PHONE_NUMBER_ID",
"additionalFields": {},
"recipientPhoneNumber": "={{ $json.metadata.whatsappNo }}"
},
"typeVersion": 1
},
{
"id": "acdea2c0-a22a-4fab-a841-9434855c6649",
"name": "检查预约支付方式1",
"type": "n8n-nodes-base.if",
"position": [
-208,
1696
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "db474e67-49c7-4af8-be5c-ebc9131d3618",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.payment_method }}",
"rightValue": "stripe"
},
{
"id": "dc3106e3-8c0a-4878-9dbb-9bb40c6bda26",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.payment_method }}",
"rightValue": "=Stripe"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "e2f7870c-3123-469d-93ad-029f4fbe4c4b",
"name": "生成 Stripe 支付链接1",
"type": "n8n-nodes-base.httpRequest",
"position": [
16,
1696
],
"parameters": {
"url": "https://api.stripe.com/v1/checkout/sessions",
"method": "POST",
"options": {},
"sendBody": true,
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "metadata[appointmentId]",
"value": "={{ $('Look For New Appointment1').item.json.appointment_id }}"
},
{
"name": "line_items[0][quantity]",
"value": "1"
},
{
"name": "line_items[0][price_data][product_data][name]",
"value": "Appointment Booking"
},
{
"name": "line_items[0][price_data][unit_amount]",
"value": "5000"
},
{
"name": "line_items[0][price_data][currency]",
"value": "usd"
},
{
"name": "mode",
"value": "payment"
},
{
"name": "success_url",
"value": "https://wa.me/YOUR_NUMBER_HERE"
},
{
"name": "cancel_url",
"value": "https://wa.me/YOUR_NUMBER_HERE"
},
{
"name": "metadata[whatsappNo]",
"value": "={{ $('Look For New Appointment1').item.json.whatsapp_number }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/x-www-form-urlencoded"
},
{
"name": "Authorization",
"value": "Bearer YOUR_STRIPE_SECRET_KEY"
}
]
}
},
"typeVersion": 4.2
}
],
"pinData": {},
"connections": {
"Config": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Send message",
"type": "main",
"index": 0
}
]
]
},
"Add Patient": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Date & Time": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Date & Time2": {
"ai_tool": [
[
{
"node": "Appointment Reminder AI Agent1",
"type": "ai_tool",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Add Appointment": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Stripe Trigger1": {
"main": [
[
{
"node": "Retrieve Payment Session1",
"type": "main",
"index": 0
}
]
]
},
"WhatsApp Trigger": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger1": {
"main": [
[
{
"node": "Appointment Reminder AI Agent1",
"type": "main",
"index": 0
}
]
]
},
"Cancel Appointment": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Stripe Refund API1": {
"main": [
[
{
"node": "Send Cancellation Message (STRIPE)",
"type": "main",
"index": 0
},
{
"node": "Update Refund Status1",
"type": "main",
"index": 0
}
]
]
},
"Get All Appointments": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Check Is Amount Paid1": {
"main": [
[
{
"node": "Stripe Refund API1",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Cancellation Message (CASH)",
"type": "main",
"index": 0
}
]
]
},
"Get User Appointments": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get Appointment sheet1": {
"ai_tool": [
[
{
"node": "Appointment Reminder AI Agent1",
"type": "ai_tool",
"index": 0
}
]
]
},
"Google Sheets Trigger1": {
"main": [
[
{
"node": "Check status \"Cancelled\"1",
"type": "main",
"index": 0
}
]
]
},
"Reschedule Appointment": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Check status \"Cancelled\"1": {
"main": [
[
{
"node": "Check Is Amount Paid1",
"type": "main",
"index": 0
}
]
]
},
"Get Patient List For User": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Google Gemini Chat Model3": {
"ai_languageModel": [
[
{
"node": "Appointment Reminder AI Agent1",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Look For New Appointment1": {
"main": [
[
{
"node": "Check Appointment Payment Mode1",
"type": "main",
"index": 0
}
]
]
},
"Retrieve Payment Session1": {
"main": [
[
{
"node": "Mark Payment Paid1",
"type": "main",
"index": 0
},
{
"node": "Send Payment Confirmation1",
"type": "main",
"index": 0
}
]
]
},
"Generate Stripe Payment Link1": {
"main": [
[
{
"node": "Send Payment Link1",
"type": "main",
"index": 0
}
]
]
},
"Check Appointment Payment Mode1": {
"main": [
[
{
"node": "Generate Stripe Payment Link1",
"type": "main",
"index": 0
}
]
]
},
"Send message in WhatsApp Business Cloud": {
"ai_tool": [
[
{
"node": "Appointment Reminder AI Agent1",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 内容创作, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用AI生成并发布独特的MCQ投票到Telegram
使用Gemini AI和Google Sheets生成独特的多选题投票并发布至Telegram
If
Aggregate
Http Request
+8
15 节点Pawan
内容创作
1. 播放列表详情设置机器人副本
使用 Suno、GPT-4、Runway 和 Creatomate 创建 AI 生成的 YouTube 音乐播放列表
If
Set
Code
+22
203 节点Joseph
内容创作
使用Gemini AI和Elementor为多个客户生成并安排SEO博客文章
使用Gemini AI和Elementor为多个客户生成并安排SEO博客文章
If
N8n
Set
+12
39 节点Zain Khan
内容创作
基于 AI、JotForm、WhatsApp 和日历的自动化律师事务所线索管理与排程
基于 AI、JotForm、WhatsApp 和日历的自动化律师事务所线索管理与排程
If
Whats App
Google Sheets
+8
16 节点iamvaar
内容创作
基于 YouTube 视频的自主博客发布
使用 ChatGPT、Sheets、Apify、Pexels 和 WordPress 从 YouTube 视频自主发布博客
If
Set
Code
+18
80 节点Oriol Seguí
内容创作
合并
使用Suno API、Claude和Telegram机器人创建完整的20首YouTube播放列表
If
Set
Code
+17
150 节点Joseph
内容创作