自动化WhatsApp客户支持,含语音转录、FAQ和预约安排
这是一个Miscellaneous, AI Chatbot, Multimodal AI领域的自动化工作流,包含 23 个节点。主要使用 If, Set, Switch, WhatsApp, HttpRequest 等节点。 自动化WhatsApp客户支持,含语音转录、FAQ和预约安排
- •可能需要目标 API 的认证凭证
- •OpenAI API Key
- •Google Sheets API 凭证
- •Google Gemini API Key
使用的节点 (23)
{
"meta": {
"instanceId": "04c7c3f1743831184e4a6edaf1f906dbab0c745cc98b8af3ef7660bbefe74cb4",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "93118333-81b4-48a6-b5e4-ccc1eb2915df",
"name": "WhatsApp消息接收",
"type": "n8n-nodes-base.whatsAppTrigger",
"position": [
-592,
0
],
"webhookId": "190af2b7-6938-422f-8c6b-2e13e421b3e6",
"parameters": {
"options": {
"messageStatusUpdates": [
"all"
]
},
"updates": [
"messages"
]
},
"credentials": {
"whatsAppTriggerApi": {
"id": "",
"name": ""
}
},
"typeVersion": 1
},
{
"id": "c2db53c3-7a90-444a-a785-a439ef835434",
"name": "无操作,不执行任何操作",
"type": "n8n-nodes-base.noOp",
"position": [
-416,
144
],
"parameters": {},
"typeVersion": 1
},
{
"id": "c528b6af-a39d-4e86-9542-1c1dd066af22",
"name": "是消息吗?",
"type": "n8n-nodes-base.if",
"position": [
-416,
0
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "0655157c-cac4-4993-af22-d167b2343297",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ !!$json.messages?.[0]?.from }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "4c6e405c-53f8-477d-a55a-9fdc3ae7fbaf",
"name": "转录音频",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
320,
-32
],
"parameters": {
"options": {},
"resource": "audio",
"operation": "transcribe"
},
"credentials": {
"openAiApi": {
"id": "",
"name": ""
}
},
"typeVersion": 1.8
},
{
"id": "df6ac069-fe1e-41d3-a872-571bae411220",
"name": "下载语音",
"type": "n8n-nodes-base.whatsApp",
"position": [
0,
-32
],
"webhookId": "8b4c0792-1956-4cf3-b6fb-390606d3e028",
"parameters": {
"resource": "media",
"operation": "mediaUrlGet",
"mediaGetId": "={{ $json.messages[0].audio.id }}"
},
"credentials": {
"whatsAppApi": {
"id": " ",
"name": " "
}
},
"typeVersion": 1
},
{
"id": "8f30d58e-2eb3-47d7-b39f-92b85678b962",
"name": "获取音频",
"type": "n8n-nodes-base.httpRequest",
"position": [
160,
-32
],
"parameters": {
"url": "={{ $json.url }}",
"options": {},
"authentication": "predefinedCredentialType",
"nodeCredentialType": "whatsAppApi"
},
"credentials": {
"whatsAppApi": {
"id": " ",
"name": " "
}
},
"typeVersion": 4.2
},
{
"id": "4090b5c6-fa50-4350-8f29-c18be5aea6f0",
"name": "获取日程",
"type": "n8n-nodes-base.googleCalendarTool",
"position": [
1168,
224
],
"parameters": {
"limit": 3,
"options": {},
"timeMax": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Before', ``, 'string') }}",
"timeMin": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('After', ``, 'string') }}",
"calendar": {
"__rl": true,
"mode": "list",
"value": "your.email@gmail.com",
"cachedResultName": "your.email@gmail.com"
},
"operation": "getAll"
},
"credentials": {
"googleCalendarOAuth2Api": {
"id": "",
"name": ""
}
},
"typeVersion": 1.3
},
{
"id": "85f332ff-cda7-43c1-9042-3a601d96075d",
"name": "AI记忆",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
720,
32
],
"parameters": {
"sessionKey": "={{ $json.chat_id }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.3
},
{
"id": "dc0b8085-4b5b-4ff9-aaf2-99c291caa1d4",
"name": "设置预约",
"type": "n8n-nodes-base.googleCalendarTool",
"position": [
1408,
224
],
"parameters": {
"end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('End', ``, 'string') }}",
"start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start', ``, 'string') }}",
"calendar": {
"__rl": true,
"mode": "list",
"value": "your.email@gmail.com",
"cachedResultName": "your.email@gmail.com"
},
"additionalFields": {}
},
"credentials": {
"googleCalendarOAuth2Api": {
"id": "",
"name": ""
}
},
"typeVersion": 1.3
},
{
"id": "0efd193c-a796-4ca1-905b-a3bdd6aac5e2",
"name": "客户服务代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
720,
-160
],
"parameters": {
"text": "={{ $json.text }}",
"options": {
"systemMessage": "=**System Prompt for WhatsApp Customer Service Bot**\n\nYou are a helpful and professional **WhatsApp customer service assistant**.\nYou always respond politely, concisely, and in a friendly tone.\nYou can answer FAQs, provide service information, and schedule appointments.\nYou must always use the provided tools to complete tasks. Do not invent answers.\n\n### Tools you must use:\n\n1. **faq_base**\n * Retrieves FAQs from a Google Sheet.\n * Returns a table with: `id | question | answer`.\n * Use when the user asks a general or frequently asked question.\n * Your job: search for the closest matching question and return the most relevant answer.\n\n2. **get_services**\n * Retrieves service information from a Google Sheet.\n * Returns a table with: `id | service_name | service_description | price`.\n * Use when the user asks about services, details, or prices.\n\n3. **get_schedule**\n * Checks Google Calendar for available time slots.\n * Input: service type, preferred day/time.\n * Returns 3 available slot options.\n * Ask the user to choose one.\n\n4. **set_appointment**\n * Books the confirmed appointment in Google Calendar.\n * Input: chosen service, date/time, and customer details (name, email, phone).\n\n5. **agent_reply**\n * Sends messages back to the user on WhatsApp.\n * Always use this tool to answer back to the user.\n\n### Rules of Behavior\n\n* Always use `agent_reply` to send every response.\n* Never make up answers — always rely on the tools.\n* If the user’s request is unclear, ask clarifying questions.\n* For FAQs: query `faq_base`.\n* For service details: query `get_services`.\n* For scheduling:\n\n 1. Ask the user which service they want.\n 2. Ask for preferred day and time.\n 3. Call `get_schedule` and show 3 options.\n 4. Collect name, email, phone number.\n 5. Call `set_appointment`.\n 6. Confirm booking with the user.\n"
},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "3d698916-6647-4f37-8d25-14d5f6b8ef51",
"name": "常见问题库",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
672,
224
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "",
"cachedResultName": "FAQ"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1YEf9xuQGoOFKOxiTHDCJSz-m-Oke-SPj8dY6Nd4Np4c",
"cachedResultUrl": "",
"cachedResultName": "Database"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": ""
}
},
"typeVersion": 4.7
},
{
"id": "24d7069b-7738-47cd-8932-c557676fc9c2",
"name": "智能体上下文",
"type": "n8n-nodes-base.set",
"position": [
544,
-160
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "7182b6f8-b1b2-4dd8-a5a0-d0c820816767",
"name": "chat_id",
"type": "string",
"value": "={{ $('WhatsApp Message Received').item.json.metadata.phone_number_id }}"
},
{
"id": "433cf6ab-8939-412b-aa92-6fca6af534e9",
"name": "from",
"type": "string",
"value": "={{ $('WhatsApp Message Received').item.json.messages[0].from }}"
},
{
"id": "f19e6d2a-6ffa-41e3-8ff3-44b70976d0d4",
"name": "text",
"type": "string",
"value": "={{ $json.text || $('WhatsApp Message Received').item.json.messages[0]?.text?.body || ''}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "9e7842c0-de0f-4aac-a830-bc70a4e4b614",
"name": "聊天路由",
"type": "n8n-nodes-base.switch",
"position": [
-208,
-144
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "text",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "a561aab7-4c3b-4c96-9bb7-078281b5c7d5",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "text"
}
]
},
"renameOutput": true
},
{
"outputKey": "voice",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b7f1055d-6651-416f-b0cd-c46e003d4f3a",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "audio"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "8fb27413-ab5f-4757-afe8-1df81dcf578d",
"name": "获取服务",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
928,
224
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1356596420,
"cachedResultUrl": "",
"cachedResultName": "SERVICES"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1YEf9xuQGoOFKOxiTHDCJSz-m-Oke-SPj8dY6Nd4Np4c",
"cachedResultUrl": "",
"cachedResultName": "Database"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": ""
}
},
"typeVersion": 4.7
},
{
"id": "b83be440-9e12-44fd-b003-7526dd835905",
"name": "AI聊天",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
608,
32
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "",
"name": ""
}
},
"typeVersion": 1
},
{
"id": "ef0a1451-f68b-40f5-a7d6-c0a0fa4ea87d",
"name": "发送消息",
"type": "n8n-nodes-base.whatsApp",
"position": [
1360,
-160
],
"webhookId": "9a7a2303-94a0-41d3-bd40-5bfb3dfa3080",
"parameters": {
"textBody": "={{ $json.output }}",
"operation": "send",
"phoneNumberId": "={{ $('Agent Context').item.json.chat_id }}",
"additionalFields": {},
"recipientPhoneNumber": "={{ $('Agent Context').item.json.from }}"
},
"credentials": {
"whatsAppApi": {
"id": "",
"name": ""
}
},
"typeVersion": 1
},
{
"id": "cb3bc335-7def-4ed5-962d-8dcd33e383f6",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1200,
-640
],
"parameters": {
"width": 864,
"height": 608,
"content": "## 具备常见问题和预约安排功能的 WhatsApp 客服机器人"
},
"typeVersion": 1
},
{
"id": "cbd8557c-b7cf-4c3b-819f-185627c444c9",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
592,
256
],
"parameters": {
"color": 5,
"height": 368,
"content": "## 常见问题处理"
},
"typeVersion": 1
},
{
"id": "1f6d9f0f-6bfb-4b4d-ae94-5af40e4c395e",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
848,
256
],
"parameters": {
"color": 5,
"height": 368,
"content": "## 服务信息"
},
"typeVersion": 1
},
{
"id": "2738b689-a5ab-4e15-bf33-c133cc07dc98",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1104,
256
],
"parameters": {
"color": 6,
"height": 368,
"content": "## 日程可用性"
},
"typeVersion": 1
},
{
"id": "796d6a12-5046-4d6a-aae2-b659d7bebe30",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1360,
256
],
"parameters": {
"color": 6,
"width": 224,
"height": 368,
"content": "## 预约确认"
},
"typeVersion": 1
},
{
"id": "a795a3d0-5f77-46ed-af14-8c68c057c88c",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1248,
-336
],
"parameters": {
"color": 4,
"width": 320,
"height": 336,
"content": "## WhatsApp 回复"
},
"typeVersion": 1
},
{
"id": "beef1f37-e019-49f3-a64b-944b3a448fe0",
"name": "### 需要帮助?",
"type": "n8n-nodes-base.stickyNote",
"position": [
-48,
-48
],
"parameters": {
"color": 2,
"width": 512,
"height": 288,
"content": "## 语音笔记转录"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"ai_chat": {
"ai_languageModel": [
[
{
"node": "Customer Service Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"faq_base": {
"ai_tool": [
[
{
"node": "Customer Service Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get Audio": {
"main": [
[
{
"node": "Transcribe audio",
"type": "main",
"index": 0
}
]
]
},
"ai_memory": {
"ai_memory": [
[
{
"node": "Customer Service Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Chat Router": {
"main": [
[
{
"node": "Agent Context",
"type": "main",
"index": 0
}
],
[
{
"node": "Download Voice",
"type": "main",
"index": 0
}
]
]
},
"Is Message?": {
"main": [
[
{
"node": "Chat Router",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"get_schedule": {
"ai_tool": [
[
{
"node": "Customer Service Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"get_services": {
"ai_tool": [
[
{
"node": "Customer Service Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Agent Context": {
"main": [
[
{
"node": "Customer Service Agent",
"type": "main",
"index": 0
}
]
]
},
"Download Voice": {
"main": [
[
{
"node": "Get Audio",
"type": "main",
"index": 0
}
]
]
},
"set_appointment": {
"ai_tool": [
[
{
"node": "Customer Service Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Transcribe audio": {
"main": [
[
{
"node": "Agent Context",
"type": "main",
"index": 0
}
]
]
},
"Customer Service Agent": {
"main": [
[
{
"node": "Send message",
"type": "main",
"index": 0
}
]
]
},
"WhatsApp Message Received": {
"main": [
[
{
"node": "Is Message?",
"type": "main",
"index": 0
}
]
]
}
}
}如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 杂项, AI 聊天机器人, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
AureusR
@aureusrExperienced Operations and Workflow Manager with a Master’s degree in Electronics and Software Development. I specialize in designing and implementing efficient, automated systems that help teams save time, reduce errors, and scale with confidence. My expertise spans across business process optimization, automation platforms, and custom workflow solutions. Looking to streamline your operations? Book a consultation with me to explore tailored automation strategies and n8n-powered workflows.
分享此工作流