使用 VAPI 构建 AI 语音助手
高级
这是一个Miscellaneous, AI Chatbot, Multimodal AI领域的自动化工作流,包含 25 个节点。主要使用 Set, Webhook, HttpRequest, Agent, WooCommerceTool 等节点。 WooCommerce AI语音客服,使用VAPI、GPT-4o、Gemini和RAG
前置要求
- •HTTP Webhook 端点(n8n 会自动生成)
- •可能需要目标 API 的认证凭证
- •OpenAI API Key
- •Qdrant 服务器连接信息
- •Google Gemini API Key
使用的节点 (25)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "EMOh4weW7QKklbyb",
"meta": {
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
"templateCredsSetupCompleted": true
},
"name": "使用 VAPI 构建 AI 语音助手",
"tags": [],
"nodes": [
{
"id": "784ae812-b3e9-4768-a108-ac3f5fd0e965",
"name": "问答链",
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
"position": [
736,
3728
],
"parameters": {
"text": "={{ $json.body.search }}",
"options": {
"systemPromptTemplate": "=You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question.\nIf you don't know the answer, just say that you don't know, don't try to make up an answer.\n\nToday is {{ $now }}\n\n----------------\nContext: {context}"
},
"promptType": "define"
},
"typeVersion": 1.5
},
{
"id": "1a051d79-3738-4e64-b97f-ac581e724d95",
"name": "Google Gemini 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
624,
3952
],
"parameters": {
"options": {},
"modelName": "models/gemini-1.5-flash"
},
"credentials": {
"googlePalmApi": {
"id": "AaNPKXAphyMzRgfA",
"name": "Google Gemini(PaLM) (Eure)"
}
},
"typeVersion": 1
},
{
"id": "31c0a7f1-45a2-4ed2-adbd-423f1fcc7bb7",
"name": "向量存储检索器",
"type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
"position": [
832,
3936
],
"parameters": {
"topK": 5
},
"typeVersion": 1
},
{
"id": "bb55684d-6c5b-4518-ae49-206f5f163c3c",
"name": "Qdrant 向量存储1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
"position": [
752,
4128
],
"parameters": {
"options": {},
"qdrantCollection": {
"__rl": true,
"mode": "list",
"value": "negozio-emporio-verde",
"cachedResultName": "negozio-emporio-verde"
}
},
"credentials": {
"qdrantApi": {
"id": "iyQ6MQiVaF3VMBmt",
"name": "QdrantApi account (Hetzner)"
}
},
"typeVersion": 1.1
},
{
"id": "f530e2ad-645d-4b89-94f0-44f62522917a",
"name": "OpenAI 嵌入",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
736,
4304
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "4zwP0MSr8zkNvvV9",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "5b11f5d5-78f6-4095-b5a8-88630fce649e",
"name": "rag",
"type": "n8n-nodes-base.webhook",
"position": [
352,
3728
],
"webhookId": "5ca93cd6-7f7b-4c91-acff-c324e594cca7",
"parameters": {
"path": "5ca93cd6-7f7b-4c91-acff-c324e594cca7",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2.1
},
{
"id": "07ab5e01-4fff-414e-9843-cf9382aac4df",
"name": "get_order",
"type": "n8n-nodes-base.wooCommerceTool",
"position": [
1072,
3408
],
"parameters": {
"orderId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Order_ID', `Order Details Retrieval Process:\n1. Request Order Number\n - Explicitly ask customer for the complete order number\n\n2. Identity Verification\n - Ask for the email address associated with the order\n - Strictly verify that the provided email matches the order record\n - If email does NOT match the order:\n * Immediately halt the process\n * Inform customer that the email is incorrect\n * Do NOT provide the correct email\n * Prevent access to order details\n\n3. Verification Criteria\n - Exact match of email to order record is mandatory\n - No exceptions or workarounds\n - Customer must provide the precise, correct email`, 'string') }}",
"resource": "order",
"operation": "get"
},
"credentials": {
"wooCommerceApi": {
"id": "nCgFKMfBO95v38Mp",
"name": "WooCommerce (magnanigioielli.com)"
}
},
"typeVersion": 1
},
{
"id": "b83afd81-7e3e-43bb-8581-ee82d76b9330",
"name": "get_orders",
"type": "n8n-nodes-base.wooCommerceTool",
"position": [
1184,
3408
],
"parameters": {
"options": {
"search": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Search', ``, 'string') }}"
},
"resource": "order",
"operation": "getAll",
"returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}"
},
"credentials": {
"wooCommerceApi": {
"id": "nCgFKMfBO95v38Mp",
"name": "WooCommerce (magnanigioielli.com)"
}
},
"typeVersion": 1
},
{
"id": "22d61db2-97b4-40da-852d-676b50ef7d26",
"name": "get_user",
"type": "n8n-nodes-base.wooCommerceTool",
"position": [
1280,
3408
],
"parameters": {
"filters": {
"email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Email', ``, 'string') }}"
},
"resource": "customer",
"operation": "getAll",
"returnAll": true
},
"credentials": {
"wooCommerceApi": {
"id": "nCgFKMfBO95v38Mp",
"name": "WooCommerce (magnanigioielli.com)"
}
},
"typeVersion": 1
},
{
"id": "7026a8d5-43a7-48db-a337-1b3a9f457ddb",
"name": "计算器",
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"position": [
768,
3408
],
"parameters": {},
"typeVersion": 1
},
{
"id": "fb4d1894-4d09-4f3c-af85-de2fe67d5967",
"name": "get_tracking",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
928,
3408
],
"parameters": {
"name": "get_tracking",
"workflowId": {
"__rl": true,
"mode": "id",
"value": "EMOh4weW7QKklbyb"
},
"description": "通过提供订单号获取特定订单的追踪号码。该工具检索唯一的追踪代码,让客户能够监控其包裹的当前状态和位置。",
"workflowInputs": {
"value": {
"order_number": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('order_number', ``, 'string') }}"
},
"schema": [
{
"id": "order_number",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "order_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"order_number"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"typeVersion": 2.1
},
{
"id": "caacd925-11eb-4f11-a3bb-6381f74b5fc8",
"name": "当由另一个工作流执行时",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
1472,
3392
],
"parameters": {
"inputSource": "jsonExample",
"jsonExample": "{\n \"order_number\": \"order number\"\n}"
},
"typeVersion": 1.1
},
{
"id": "11504f43-0dce-4eef-a461-a0fd080b94e3",
"name": "售后客服代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
624,
3120
],
"parameters": {
"text": "=Order Information:\nEmail: {{ $json.body.email }}\nOrder number: {{ $json.body.n_order }}",
"options": {
"systemMessage": "=## Role and Primary Objective\nYou are a customer support AI agent for an online clothing store, specializing in post-sales assistance. Your primary goals are to:\n- Help customers track their orders\n- Provide information about past and current orders\n- Offer clear and concise support\n\n## Communication Guidelines\n1. Always be professional, helpful, and precise\n2. Use available tools to retrieve accurate information\n3. Verify customer identity before sharing order details\n4. Protect customer privacy and data confidentiality\n\n## Tool Usage Instructions\n\n### Order Information Retrieval\n- Use `get_order` to fetch details for a single order\n - REQUIRED: Complete user information including request, email, and order number\n- Use `get_orders` to retrieve multiple orders for a single customer\n- Use `get_user` to obtain customer profile information\n\n### Tracking and Support\n- Use `get_tracking` to obtain tracking information for an order using the order number\n- If a customer cannot find what they need, use `human*assistance`\n - Synthesize the request clearly\n - Include associated user email\n - Provide concise, relevant details\n\n### General Information\n- Use `ToS` tool to answer questions about:\n - Terms and Conditions\n - Shipping information\n - General store policies\n\n## Critical Verification Rules\n- ALWAYS verify that the email provided matches the order number\n- If the email does not match the order:\n - DO NOT provide the correct email\n - Inform the customer that the email address is incorrect\n - Request the correct email associated with the order\n\n## Prohibited Actions\n- Never disclose sensitive customer information\n- Do not share full order details without proper verification\n- Avoid providing speculative or unconfirmed information\n\n## Communication Style\n- Be direct and helpful\n- Use clear, professional language\n- Focus on solving the customer's specific query\n- Provide step-by-step guidance when necessary\n\nToday is {{$now}}"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "571a225d-edc8-499e-a48d-5d8253d38b64",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1456,
3216
],
"parameters": {
"color": 5,
"width": 532,
"height": 136,
"content": "追踪代码请求通过最受欢迎的 WooCommerce 追踪插件 \"YITH WooCommerce Order & Shipment Tracking\" 实现。免费版本可[在此下载](https://wordpress.org/plugins/yith-woocommerce-order-tracking/)"
},
"typeVersion": 1
},
{
"id": "c0d82557-5f90-4115-8673-216e2274f25d",
"name": "获取追踪信息",
"type": "n8n-nodes-base.httpRequest",
"position": [
1648,
3392
],
"parameters": {
"url": "=https://URL/wp-json/wc/v3/orders/{{ $json.order_number }}",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth"
},
"credentials": {
"httpBasicAuth": {
"id": "nIitKwSJa9EpgG8K",
"name": "WP (magnanigioielli.com)"
}
},
"typeVersion": 4.2
},
{
"id": "85450f4c-7329-4876-af32-792764d1c726",
"name": "设置追踪代码",
"type": "n8n-nodes-base.set",
"position": [
1824,
3392
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "19b33abc-5191-4449-b682-4466f1975ff2",
"name": "tracking_code",
"type": "string",
"value": "={{ $json[\"meta_data\"].find(item => item.key === \"ywot_tracking_code\").value }}"
},
{
"id": "2e18b337-e3e8-4669-a902-ecc2ba027a1a",
"name": "carrier_url",
"type": "string",
"value": "={{ $json[\"meta_data\"].find(item => item.key === \"ywot_carrier_url\").value }}"
},
{
"id": "ae834f65-67b2-4e95-9a49-5172e36fc5b9",
"name": "pick_up",
"type": "string",
"value": "={{ $json[\"meta_data\"].find(item => item.key === \"ywot_pick_up_date\").value }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "1153e7e1-269a-472f-8dc5-df3b59a48705",
"name": "GPT 4o-mini",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
464,
3408
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "4zwP0MSr8zkNvvV9",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "5a29fd84-fb55-4f89-98a4-a7ba0c5f3889",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
352,
3120
],
"webhookId": "f265a558-2787-4f8c-96a1-7b1068e45d3c",
"parameters": {
"path": "f265a558-2787-4f8c-96a1-7b1068e45d3c",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2.1
},
{
"id": "a5aef818-952a-401e-bfa4-a6e2ec1b52de",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
3136
],
"parameters": {
"color": 4,
"width": 384,
"height": 112,
"content": "## 售后客服代理"
},
"typeVersion": 1
},
{
"id": "2d963ce1-5a68-4f59-9162-8e256349f056",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-96,
3728
],
"parameters": {
"color": 4,
"width": 400,
"height": 144,
"content": "## 基本信息"
},
"typeVersion": 1
},
{
"id": "8b837fa9-8c26-4454-97a6-0a0d7e0cd0e2",
"name": "设置响应",
"type": "n8n-nodes-base.set",
"position": [
976,
3120
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "d6a208ab-3fb3-4b4a-9615-b29183bbce39",
"name": "message",
"type": "string",
"value": "={{ $json.output }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "1ef5425b-d66b-44b6-985b-5cc5adcb3ca6",
"name": "发送响应到 VAPI",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1216,
3120
],
"parameters": {
"options": {}
},
"typeVersion": 1.4
},
{
"id": "7a91965a-bf65-404d-86b8-69990f687e9e",
"name": "发送 RAG 响应到 VAPI",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1216,
3728
],
"parameters": {
"options": {}
},
"typeVersion": 1.4
},
{
"id": "cbebeb82-f172-45d6-afa6-9f8409a8432d",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-96,
2624
],
"parameters": {
"width": 1072,
"height": 368,
"content": "## 步骤 1"
},
"typeVersion": 1
},
{
"id": "dbd67324-fb3e-4559-a013-33e37216900c",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-96,
2384
],
"parameters": {
"color": 3,
"width": 1072,
"height": 208,
"content": "## 使用 VAPI 和 Twilio 为 WooCommerce 构建 AI 语音助手(售后客服与 RAG)"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "abceb79d-e0c7-4d43-b622-7f24d92563b0",
"connections": {
"rag": {
"main": [
[
{
"node": "Question and Answer Chain",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "Post-Sales Agent",
"type": "main",
"index": 0
}
]
]
},
"get_user": {
"ai_tool": [
[
{
"node": "Post-Sales Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"get_order": {
"ai_tool": [
[
{
"node": "Post-Sales Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Calculator": {
"ai_tool": [
[
{
"node": "Post-Sales Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"get_orders": {
"ai_tool": [
[
{
"node": "Post-Sales Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"GPT 4o-mini": {
"ai_languageModel": [
[
{
"node": "Post-Sales Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Get tracking": {
"main": [
[
{
"node": "Set tracking code",
"type": "main",
"index": 0
}
]
]
},
"Set response": {
"main": [
[
{
"node": "Send response to VAPI",
"type": "main",
"index": 0
}
]
]
},
"get_tracking": {
"ai_tool": [
[
{
"node": "Post-Sales Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Post-Sales Agent": {
"main": [
[
{
"node": "Set response",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Qdrant Vector Store1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Qdrant Vector Store1": {
"ai_vectorStore": [
[
{
"node": "Vector Store Retriever",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Vector Store Retriever": {
"ai_retriever": [
[
{
"node": "Question and Answer Chain",
"type": "ai_retriever",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Question and Answer Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Question and Answer Chain": {
"main": [
[
{
"node": "Send RAG response to VAPI",
"type": "main",
"index": 0
}
]
]
},
"When Executed by Another Workflow": {
"main": [
[
{
"node": "Get tracking",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 杂项, AI 聊天机器人, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
WooCommerce AI售后支持聊天机器人工作流
WooCommerce AI售后聊天机器人,集成GPT4o、RAG、Google Drive和Telegram
Set
Google Drive
Http Request
+16
31 节点Davide
销售
基于 GPT-4、Stripe 和 CRM 集成的 WooCommerce 对话式销售代理
基于 GPT-4、Stripe 和 CRM 集成的 WooCommerce 对话式销售代理
Set
Google Drive
Http Request
+16
27 节点Cong Nguyen
AI 聊天机器人
在可视化参考库中探索n8n节点
在可视化参考库中探索n8n节点
If
Ftp
Set
+93
113 节点I versus AI
其他
我的智能体竞技场社区竞赛
使用Qdrant、Mistral OCR和GPT-4构建基于RAG的问答系统
Set
Code
Wait
+19
41 节点Davide
内容创作
使用 Qdrant 的完整 RAG 系统,带自动更新文档功能
使用OpenAI、Google Gemini、Qdrant和Google Drive构建自更新RAG系统
Set
Wait
Google Drive
+13
32 节点Davide
AI RAG 检索增强
使用Voiceflow、Google Calendar和RAG构建聊天机器人、语音代理和电话代理
使用Voiceflow、Google Calendar和RAG构建聊天机器人、语音和电话代理
Set
Webhook
Google Drive
+14
34 节点Davide
人工智能
工作流信息
难度等级
高级
节点数量25
分类3
节点类型16
作者
Davide
@n3witaliaFull-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at info@n3w.it or add me on Linkedin.com/in/davideboizza
外部链接
在 n8n.io 查看 →
分享此工作流