8
n8n 中文网amn8n.com

沙龙预约

高级

这是一个AI Chatbot, Multimodal AI领域的自动化工作流,包含 20 个节点。主要使用 Set, Gmail, Switch, Webhook, GoogleCalendar 等节点。 基于AI的沙龙预订,集成GPT、Google日历和邮件确认

前置要求
  • Google 账号和 Gmail API 凭证
  • HTTP Webhook 端点(n8n 会自动生成)
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "8czbnI4iBMuXq48K",
  "meta": {
    "instanceId": "ade7e20aad77e0a552d206f839739da695af286a3148c41c951c915d6af91ebc",
    "templateCredsSetupCompleted": true
  },
  "name": "沙龙预约",
  "tags": [],
  "nodes": [
    {
      "id": "4ed1dd4c-30ff-4840-bc22-09a12082e6f8",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1568,
        640
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "o3-mini",
          "cachedResultName": "o3-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "8e0c3165-0201-4fee-b602-cf9fc5976c19",
      "name": "自动修复输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        1872,
        640
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "f16c511e-d28b-4bd0-b994-ce07d406dac3",
      "name": "OpenAI 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1840,
        784
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "c83f45f7-6030-434d-b4f6-184ec99b9a49",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2000,
        768
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"is_pass_next\": \"boolean\",\n\t\"message\": \"string\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "d4d24714-7f47-4aa5-878f-80b5623114fa",
      "name": "Google Calendar MCP",
      "type": "n8n-nodes-base.switch",
      "position": [
        2208,
        464
      ],
      "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": "28a6030e-cccd-4bf5-9f87-805dd9f12fb7",
      "name": "编辑字段",
      "type": "n8n-nodes-base.set",
      "position": [
        2640,
        400
      ],
      "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": "05bff1d7-592c-473b-91c7-bb6ab23fd45e",
      "name": "Google日历",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        3328,
        368
      ],
      "parameters": {
        "end": "={{ $json.output.calendar_event.end_time }}",
        "start": "={{ $json.output.calendar_event.start_time }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "anuj@sapahk.ai",
          "cachedResultName": "anuj@sapahk.ai"
        },
        "additionalFields": {
          "color": "7",
          "summary": "={{ $json.output.email.description }}",
          "attendees": [
            "={{ $json.output.email.to }}"
          ]
        },
        "useDefaultReminders": false
      },
      "typeVersion": 1.3
    },
    {
      "id": "eefd2266-e4f8-413f-a7f3-4ecbf34158d3",
      "name": "预约代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2880,
        400
      ],
      "parameters": {
        "text": "=You are the Booking Agent for Glow & Grace Salon – Where Beauty Meets Elegance.\n\nYour job is to take finalized booking details from the Salon Agent, and:\n\nGenerate a Google Calendar event object with proper start and end time.\n\nInput from Restaurant Agent:  {{ $('Edit Fields').item.json['user_data'] }}\n\nGenerate a confirmation email with:\n\nRecipient email address\n\nEmail subject line\n\nA professional and beautifully formatted HTML body\n\n✅ Your OUTPUT must be in this structure:\n\n{\n  \"calendar_event\": {\n    \"start_time\": \"2025-06-05T10:00:00\",\n    \"end_time\": \"2025-06-05T11:30:00\",\n    \"name\": \"Olivia Brown\"\n  },\n  \"email\": {\n    \"to\": \"olivia.brown@example.com\",\n    \"subject\": \"Your Glow & Grace Salon Appointment Confirmation 💇‍♀️✨\",\n    \"html_body\": \"<html>... (full email HTML below) ...</html>\", \n    \"description\": \"Salon appointment with Olivia\"\n  }\n}\n\n\nEXAMPLE: \n<html>\n  <body style=\"font-family: Arial, sans-serif; color: #333; background-color: #fafafa; padding: 20px;\">\n    <h2 style=\"color: #C71585;\">💇‍♀️ Glow & Grace Salon – Appointment Confirmed</h2>\n    <p>Dear Olivia Brown,</p>\n    <p>We’re delighted to confirm your salon appointment with us! Here are your booking details:</p>\n    <table style=\"margin-top: 15px; border-collapse: collapse;\">\n      <tr>\n        <td><strong>Date:</strong></td>\n        <td>June 5, 2025</td>\n      </tr>\n      <tr>\n        <td><strong>Time:</strong></td>\n        <td>10:00 AM – 11:30 AM</td>\n      </tr>\n      <tr>\n        <td><strong>Services:</strong></td>\n        <td>Haircut + Blowout</td>\n      </tr>\n      <tr>\n        <td><strong>Stylist:</strong></td>\n        <td>Sophia (Master Stylist)</td>\n      </tr>\n      <tr>\n        <td><strong>Location:</strong></td>\n        <td>Glow & Grace Salon, 21 Beauty Lane, Glamour City</td>\n      </tr>\n    </table>\n    <p style=\"margin-top: 15px;\">📝 <strong>Special Notes:</strong> Requested volume styling for an evening event.</p>\n    <p>We look forward to pampering you and making you glow with confidence! ✨</p>\n    <p style=\"margin-top: 25px;\">Warm regards,<br/>The Glow & Grace Team</p>\n    <hr style=\"margin-top: 30px;\">\n    <p style=\"font-size: 12px;\">Questions? Contact us at <a href='mailto:appointments@glowandgrace.com'>appointments@glowandgrace.com</a> or call (555) 123-9876</p>\n  </body>\n</html>\n\n\n\n🧠 Behavior Notes:\n\nDefault service durations (unless specified):\n\nHaircut: 1 hour\n\nHair Color: 2 hours\n\nBlowout/Styling: 1 hour\n\nManicure/Pedicure: 1.5 hours\n\nFacial: 1 hour\n\nMassage: 1.5 hours\n\nIf multiple services are booked, add up durations in order.\n\nIf the user specifies a custom duration, honor that.\n\nFormat start and end time in ISO 8601 (RFC3339).\n\nTime zone is assumed to be the Salon’s local time: {{ $now }}",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.8
    },
    {
      "id": "ea30c358-bd1c-4703-bd3a-d779af0829a5",
      "name": "OpenAI 聊天模型2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2864,
        624
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "59665448-7d44-4f8b-a330-e6e16460785c",
      "name": "结构化输出解析器 1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3040,
        608
      ],
      "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\": \"sarah@example.com\",\n    \"subject\": \"Your Relaxing SPA Booking Confirmation – Rejuvenate & Revive Package\",\n    \"html_body\": \"<html>... (full email HTML below) ...</html>\",\n    \"description\": \"Booking with Sarah\"\n  }\n}\n"
      },
      "typeVersion": 1.2
    },
    {
      "id": "abf22778-be62-4bf2-9172-6b94bc103b1e",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1728,
        640
      ],
      "parameters": {
        "sessionKey": "={{ $json?.message?.chat?.id || $json?.body?.sessionId }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 15
      },
      "typeVersion": 1.3
    },
    {
      "id": "815868dd-3fda-483b-a076-87837c595c62",
      "name": "发送消息",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3328,
        560
      ],
      "webhookId": "c1388946-d239-4325-abde-1a9ae909797b",
      "parameters": {
        "sendTo": "={{ $json.output.email.to }}",
        "message": "={{ $json.output.email.html_body }}",
        "options": {},
        "subject": "={{ $json.output.email.subject }}"
      },
      "typeVersion": 2.1
    },
    {
      "id": "abfe4772-8b9c-47e9-83f2-b6892e625ffa",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -16
      ],
      "parameters": {
        "width": 1180,
        "height": 1120,
        "content": "## 概述"
      },
      "typeVersion": 1
    },
    {
      "id": "2714a16f-48aa-4203-92a8-7aec75ecb531",
      "name": "信息收集代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1696,
        416
      ],
      "parameters": {
        "text": "=You are the Salon Reservation Agent for Glow & Grace Salon – Premium Hair & Beauty Services.\n\nYour role is to assist users in booking a salon appointment, starting with gathering their information, confirming the booking, and ensuring it’s added to the calendar and an email is sent.\n\nUser Input: {{ $json?.message?.text || $json?.body?.message }}\n\n🎭 Tone and Behavior\n\nWarm, polite, and professional — like a friendly salon receptionist.\n\nMake the client feel cared for and pampered.\n\nAlways move step by step — never jump ahead.\n\nNever suggest random services or times — always confirm with the user.\n\n🧾 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 Glow & Grace Salon 💇‍♀️✨ Your beauty, our passion. How may I assist you today? Would you like to book an appointment?\"\n}\n\n\n2. APPOINTMENT DETAILS (Step by Step Questions)\n\nAsk one question at a time in sequence:\n\nService Type (Haircut, Hair Spa, Facial, Manicure, Pedicure, Makeup, etc.)\n\nPreferred Stylist/Therapist (if any)\n\nPreferred Date & Time\n\nSpecial Requests (bridal prep, event styling, sensitive skin, etc.)\n\nExample response if still collecting info:\n\n{\n  \"is_pass_next\": false,\n  \"message\": \"Got it! Which service would you like to book — for example haircut, facial, manicure, or something else?\"\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’s your appointment draft 💆‍♀️:\\n\\n🗓 Date & Time: [Insert Date & Time]\\n💇‍♀️ Service: [Service Type]\\n✨ Preferred Stylist: [If any]\\n🎀 Special Notes: [If any]\\n📍 Location: Glow & Grace Salon, 21 Beauty Avenue, Style 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    \"appointment_date\": \"[YYYY-MM-DD]\",\n    \"appointment_time\": \"[Time]\",\n    \"service_type\": \"[Haircut/Facial/etc.]\",\n    \"preferred_stylist\": \"[If any]\",\n    \"special_notes\": \"[Any notes from user]\"\n  }\n}\n\n\nTime zone is assumed to be the Salon's local time : {{ $now }}\n\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.8
    },
    {
      "id": "22fbf5d5-05f1-4479-bafa-ec273c68d2b3",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1392,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 740,
        "height": 820,
        "content": "### Telegram 触发器与 AI 代理流程"
      },
      "typeVersion": 1
    },
    {
      "id": "9395eadb-53ab-4790-b574-7295fda7252f",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2160,
        64
      ],
      "parameters": {
        "color": 7,
        "width": 620,
        "height": 820,
        "content": "### 切换、响应和编辑字段"
      },
      "typeVersion": 1
    },
    {
      "id": "85b9fe22-224a-4319-8dc1-33c054c35e3d",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2800,
        64
      ],
      "parameters": {
        "color": 7,
        "width": 920,
        "height": 820,
        "content": "### 预约代理、Google Calendar 和 Gmail"
      },
      "typeVersion": 1
    },
    {
      "id": "60b74241-494f-4782-9e2e-4538094bc9d3",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1440,
        432
      ],
      "webhookId": "1306a6cb-608a-471a-a84b-f07f981c67da",
      "parameters": {
        "path": "1306a6cb-608a-471a-a84b-f07f981c67da",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "a9a98a78-447b-4b33-ba9f-553a3b40489d",
      "name": "响应 Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2432,
        640
      ],
      "parameters": {
        "options": {},
        "respondWith": "text",
        "responseBody": "={{ $('Information Gathering Agent').item.json.output.message }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "c5c6e80c-c4cb-48fc-a1f0-63477de52205",
      "name": "响应Webhook1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2432,
        432
      ],
      "parameters": {
        "options": {},
        "respondWith": "text",
        "responseBody": "Thank you for your confirmation! We have noted down your information. You will be getting confirmation mail soon. "
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d2c0a675-cc2f-456b-9ac0-27561f1acec2",
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Respond to Webhook1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Information Gathering Agent",
            "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
          }
        ]
      ]
    },
    "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
          }
        ]
      ]
    },
    "Respond to Webhook1": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "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
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - AI 聊天机器人, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量20
分类2
节点类型12
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

外部链接
在 n8n.io 查看

分享此工作流