8
n8n 中文网amn8n.com

使用 Google 日历和表格创建 AI 驱动的虚拟接待员

中级

这是一个Miscellaneous, AI Chatbot, Multimodal AI领域的自动化工作流,包含 12 个节点。主要使用 GoogleSheets, Agent, GoogleSheetsTool, GoogleCalendarTool, ChatTrigger 等节点。 使用 Google 日历和表格创建 AI 驱动的虚拟接待员

前置要求
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "a2decaa80798f56a13dbca1aa742181dfea463e822cc650b5a716ef8b115667a"
  },
  "nodes": [
    {
      "id": "e38100f0-54dd-4a75-a3bd-3b6295ca96d0",
      "name": "对话记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        336,
        16
      ],
      "parameters": {
        "contextWindowLength": 15
      },
      "typeVersion": 1.3
    },
    {
      "id": "22a387d3-ffdd-4221-b27d-dde8711c1186",
      "name": "检查日历可用性",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        720,
        16
      ],
      "parameters": {
        "options": {},
        "timeMax": "={{ $fromAI('end_datetime', `End datetime in ISO format with timezone (YYYY-MM-DDTHH:MM:SS+TZ) for availability check`, 'string') }}",
        "timeMin": "={{ $fromAI('start_datetime', `Start datetime in ISO format with timezone (YYYY-MM-DDTHH:MM:SS+TZ) for availability check`, 'string') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "ris362720@gmail.com",
          "cachedResultName": "ris362720@gmail.com"
        },
        "resource": "calendar"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "ZKFdGvnaSxLoLCiO",
          "name": "Google Calendar account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "f62ef70f-6295-4a02-8342-83d3a67d5429",
      "name": "预订日历预约",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        592,
        16
      ],
      "parameters": {
        "end": "={{ $fromAI('end_datetime', `End datetime in ISO format with timezone (YYYY-MM-DDTHH:MM:SS+TZ)`, 'string') }}",
        "start": "={{ $fromAI('start_datetime', `Start datetime in ISO format with timezone (YYYY-MM-DDTHH:MM:SS+TZ)`, 'string') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "ris362720@gmail.com",
          "cachedResultName": "ris362720@gmail.com"
        },
        "additionalFields": {
          "summary": "={{ $fromAI('event_title', `Event title with customer name and service`, 'string') }}",
          "description": "={{ $fromAI('event_description', `Detailed event description including: Business name, Service type, Duration, Customer name, Phone, Special notes`, 'string') }}"
        },
        "useDefaultReminders": false
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "ZKFdGvnaSxLoLCiO",
          "name": "Google Calendar account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "ca5ad6d5-227f-4776-9f37-ed9497d838d9",
      "name": "保存预约记录",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        464,
        16
      ],
      "parameters": {
        "columns": {
          "value": {
            "summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('summary', `summary conversation`, 'string') }}",
            "event_id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('event_id', ``, 'string') }}",
            "services": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('services', ``, 'string') }}",
            "patient name ": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('patient_name_', ``, 'string') }}",
            "patient number": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('patient_number', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "patient number",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "patient number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "patient name ",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "patient name ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "event_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "event_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "services",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "services",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1454968607,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1sEfkvCT_4GGlleZKcQfWy1Z8V2FEg2BH2eY0LDzrnt8/edit#gid=1454968607",
          "cachedResultName": "Sheet2"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1sEfkvCT_4GGlleZKcQfWy1Z8V2FEg2BH2eY0LDzrnt8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1sEfkvCT_4GGlleZKcQfWy1Z8V2FEg2BH2eY0LDzrnt8/edit?usp=drivesdk",
          "cachedResultName": "Bussiness  details"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "fGbQfgGA6gTKu9Jd",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "c519dbd4-c95e-4c12-bd46-ccb76d4301ca",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "disabled": true,
      "position": [
        848,
        16
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\n  \"ai_reply\": \"I'd be happy to help you! What service are you interested in booking today?\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "ba1c4cff-5e5e-487a-952e-60c886cd0fb8",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -544,
        -208
      ],
      "webhookId": "73eb01dc-fa71-4f00-b3e8-17e716ef86f6",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "02fce16f-b548-4db3-a5c4-e6b06c4d0f55",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        208,
        16
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "TEPbLQLrisXKXcU1",
          "name": "n8n free OpenAI API credits"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "52494195-7502-473f-a254-afb53bf89a74",
      "name": "OpenAI 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        928,
        224
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "TEPbLQLrisXKXcU1",
          "name": "n8n free OpenAI API credits"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "44f4d1d4-6d39-45ad-ad78-a9febf0e52e2",
      "name": "获取业务详情",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -176,
        -208
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1sEfkvCT_4GGlleZKcQfWy1Z8V2FEg2BH2eY0LDzrnt8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1sEfkvCT_4GGlleZKcQfWy1Z8V2FEg2BH2eY0LDzrnt8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1sEfkvCT_4GGlleZKcQfWy1Z8V2FEg2BH2eY0LDzrnt8/edit?usp=drivesdk",
          "cachedResultName": "Bussiness  details"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "fGbQfgGA6gTKu9Jd",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "f0752315-6a90-48df-a8fe-9dda53d2c58d",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        -336
      ],
      "parameters": {
        "color": 3,
        "width": 416,
        "height": 272,
        "content": "## 获取业务详情"
      },
      "typeVersion": 1
    },
    {
      "id": "b4ebcd48-a651-4bad-b7c3-dd6939bea1ed",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -320
      ],
      "parameters": {
        "color": 4,
        "width": 976,
        "height": 528,
        "content": "## AI 接待员代理"
      },
      "typeVersion": 1
    },
    {
      "id": "4c6250f1-093a-49c1-a496-b8b883ca4787",
      "name": "AI 接待员",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        464,
        -208
      ],
      "parameters": {
        "text": "={{ $('When chat message received').item.json.chatInput }}",
        "options": {
          "systemMessage": "=# {{ $json['ai_name '] }} - {{ $json.business_name }} Virtual Receptionist\n\nYou are {{ $json['ai_name '] }}, the {{ $json.ai_personality }} virtual receptionist at **{{ $json.business_name }}**. Your role is to {{ $json.ai_role }}\n\n## BUSINESS ESSENTIALS\n\n**Type**: {{ $json[' business_type'] }}\n**Location**:  {{ $json[' location'] }}\n**Hours**:  {{ $json[' working_hours '] }}\n**Currency**: {{ $json.currency }}\n\n### Services & Pricing\n{{ $json.services }}\n\n## COMMUNICATION STYLE\n- **Tone**: {{ $json.ai_personality }}\n- **Length**: 2-3 sentences per response\n- **Approach**: Natural conversation, not robotic\n- **Use names**: Once provided, use customer's name\n\n## BOOKING WORKFLOW\n1. **Understand need**: Service type, timing preference\n2. **Check availability**: Use checkAvailability tool with business calendar\n3. **Gather details**: Name, phone number, email (optional)\n4. **Confirm booking**: Use bookAppointment tool\n5. **Save data**: Use captureCustomerData and saveAppointment tools\ntime now: {{ $now }}\n\n## KEY GUIDELINES\n\n### ✅ DO\n- Welcome warmly: \"Hello! I'm {{ $json['ai_name '] }} from {{ $json.business_name }}\"\n- Offer alternatives if requested time unavailable\n- Prioritize emergencies if emergency services available\n- Explain pricing clearly when asked\n- Use all available tools for complete booking process\n\n### ❌ DON'T\n- Give medical/professional advice outside your scope\n- Book outside business hours\n- Repeat questions already answered\n- Ask for unnecessary personal information\n- Provide vague responses about availability\n\n## EMERGENCY PROTOCOL\n{% if $('Select Business Context').item.json.emergency_available %}\nEmergencies are available. Prioritize urgent requests and offer same-day slots when possible.\n{% endif %}\n\n## BUSINESS CONTEXT\n\n- Timezone: {{ $json['timezone '] }}\n- Advance booking limit:{{ $json[' booking_advance_days '] }}  days\n- Cancellation policy: {{ $json['cancellation_hours '] }} hours notice\n\n---\nProvide responses in this JSON format:\n{\n  \"ai_reply\": \"Your helpful and personalized response here\"\n}\n\n**Remember**: You're representing {{ $json.business_name }}. Be helpful, accurate, and maintain the professional standard they expect."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.1
    }
  ],
  "pinData": {},
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Receptionist",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Conversation Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Receptionist",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Get business details": {
      "main": [
        [
          {
            "node": "AI Receptionist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Appointment Record": {
      "ai_tool": [
        [
          {
            "node": "AI Receptionist",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Receptionist",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Book Calendar Appointment": {
      "ai_tool": [
        [
          {
            "node": "AI Receptionist",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Get business details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Calendar Availability": {
      "ai_tool": [
        [
          {
            "node": "AI Receptionist",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 杂项, AI 聊天机器人, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
中级
节点数量12
分类3
节点类型9
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

外部链接
在 n8n.io 查看

分享此工作流