AI语音呼叫机器人 - OpenAI GPT-4o + ElevenLabs + Twilio集成
中级
这是一个Support Chatbot, AI Chatbot领域的自动化工作流,包含 10 个节点。主要使用 If, OpenAi, Webhook, ElevenLabs, HttpRequest 等节点。 使用GPT-4o、ElevenLabs和Twilio创建多语言语音呼叫机器人
前置要求
- •OpenAI API Key
- •HTTP Webhook 端点(n8n 会自动生成)
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "ai-voice-calling-bot",
"meta": {
"instanceId": "12345abcde67890fghij",
"templateCredsSetupCompleted": true
},
"name": "AI 语音呼叫机器人 - OpenAI GPT-4o + ElevenLabs + Twilio 集成",
"tags": [
{
"id": "ai-voice-bot",
"name": "AI Voice Bot",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
],
"nodes": [
{
"id": "webhook-start",
"name": "Twilio 语音 Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
240,
300
],
"webhookId": "voice-webhook-start",
"parameters": {
"path": "voice-webhook",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 1
},
{
"id": "check-speech-input",
"name": "检查语音输入",
"type": "n8n-nodes-base.if",
"position": [
460,
300
],
"parameters": {
"conditions": {
"options": {
"leftValue": "={{ $json.SpeechResult }}",
"operation": "exists",
"caseSensitive": true
}
}
},
"typeVersion": 1
},
{
"id": "openai-gpt",
"name": "OpenAI GPT-4o 响应",
"type": "n8n-nodes-base.openAi",
"position": [
680,
200
],
"parameters": {
"model": "gpt-4o",
"options": {
"maxTokens": 150,
"temperature": 0.7
},
"messages": {
"values": [
{
"role": "system",
"content": "You are a helpful AI assistant for a service business. You can help customers:\n1. Schedule appointments (collect name, phone, preferred date/time, service type)\n2. Order pizza (collect size, toppings, address, phone)\n3. Book other services (collect relevant details)\n\nAlways be polite, concise, and gather necessary information step by step. Keep responses under 100 words for voice calls. End with a clear question or next step."
},
{
"role": "user",
"content": "={{ $json.SpeechResult || 'Hello, how can I help you today?' }}"
}
]
}
},
"credentials": {
"openAiApi": {
"id": "openai-creds",
"name": "OpenAI API"
}
},
"typeVersion": 1
},
{
"id": "elevenlabs-tts",
"name": "ElevenLabs 文本转语音",
"type": "n8n-nodes-base.elevenLabs",
"position": [
900,
200
],
"parameters": {
"text": "={{ $json.choices[0].message.content }}",
"model_id": "eleven_monolingual_v1",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"voice_settings": {
"style": 0,
"stability": 0.75,
"similarity_boost": 0.75,
"use_speaker_boost": true
}
},
"credentials": {
"elevenLabsApi": {
"id": "elevenlabs-creds",
"name": "ElevenLabs API"
}
},
"typeVersion": 1
},
{
"id": "upload-audio",
"name": "上传音频到存储",
"type": "n8n-nodes-base.httpRequest",
"position": [
1120,
200
],
"parameters": {
"operation": "upload",
"additionalFields": {
"fileName": "response.mp3",
"contentType": "audio/mpeg"
},
"binaryPropertyName": "data"
},
"typeVersion": 3
},
{
"id": "twilio-response",
"name": "Twilio TwiML 响应",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1340,
200
],
"parameters": {
"twiml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n <Play>{{ $json.audio_url }}</Play>\n <Gather input=\"speech\" timeout=\"10\" speechTimeout=\"auto\" action=\"{{ $node.webhook.getWebhookUrl() }}\" method=\"POST\">\n <Say voice=\"alice\">Please speak after the tone.</Say>\n </Gather>\n <Say voice=\"alice\">I didn't hear anything. Goodbye!</Say>\n <Hangup/>\n</Response>"
},
"typeVersion": 1
},
{
"id": "initial-greeting",
"name": "初始问候",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
680,
400
],
"parameters": {
"twiml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n <Say voice=\"alice\">Hello! I'm your AI assistant. I can help you schedule appointments, order pizza, or book services. How can I help you today?</Say>\n <Gather input=\"speech\" timeout=\"10\" speechTimeout=\"auto\" action=\"{{ $node['Twilio Voice Webhook'].getWebhookUrl() }}\" method=\"POST\">\n <Say voice=\"alice\">Please speak after the tone.</Say>\n </Gather>\n <Say voice=\"alice\">I didn't hear anything. Please call back. Goodbye!</Say>\n <Hangup/>\n</Response>"
},
"typeVersion": 1
},
{
"id": "log-conversation",
"name": "记录对话",
"type": "n8n-nodes-base.googleSheets",
"position": [
900,
400
],
"parameters": {
"columns": {
"value": {
"call_sid": "={{ $json.CallSid }}",
"caller_id": "={{ $json.From }}",
"timestamp": "={{ $now }}",
"ai_response": "={{ $json.choices[0].message.content }}",
"speech_input": "={{ $json.SpeechResult }}"
},
"mappingMode": "defineBelow"
},
"options": {},
"operation": "append",
"sheetName": "Call_Logs",
"documentId": "your-google-sheet-id"
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "google-sheets-creds",
"name": "Google Sheets"
}
},
"typeVersion": 3
},
{
"id": "check-appointment",
"name": "检查预约",
"type": "n8n-nodes-base.if",
"position": [
1120,
400
],
"parameters": {
"conditions": {
"options": {
"leftValue": "={{ $json.choices[0].message.content.toLowerCase() }}",
"operation": "contains",
"rightValue": "appointment",
"caseSensitive": false
}
}
},
"typeVersion": 1
},
{
"id": "save-appointment",
"name": "保存预约请求",
"type": "n8n-nodes-base.googleSheets",
"position": [
1340,
500
],
"parameters": {
"columns": {
"value": {
"status": "pending",
"call_sid": "={{ $json.CallSid }}",
"caller_id": "={{ $json.From }}",
"timestamp": "={{ $now }}",
"request_details": "={{ $json.SpeechResult }}"
},
"mappingMode": "defineBelow"
},
"operation": "append",
"sheetName": "Appointments",
"documentId": "your-appointments-sheet-id"
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "google-sheets-creds",
"name": "Google Sheets"
}
},
"typeVersion": 3
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "1",
"connections": {
"Log Conversation": {
"main": [
[
{
"node": "Check for Appointment",
"type": "main",
"index": 0
}
]
]
},
"Check Speech Input": {
"main": [
[
{
"node": "OpenAI GPT-4o Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Initial Greeting",
"type": "main",
"index": 0
}
]
]
},
"Twilio Voice Webhook": {
"main": [
[
{
"node": "Check Speech Input",
"type": "main",
"index": 0
}
]
]
},
"Check for Appointment": {
"main": [
[
{
"node": "Save Appointment Request",
"type": "main",
"index": 0
}
],
[]
]
},
"OpenAI GPT-4o Response": {
"main": [
[
{
"node": "ElevenLabs Text-to-Speech",
"type": "main",
"index": 0
},
{
"node": "Log Conversation",
"type": "main",
"index": 0
}
]
]
},
"Upload Audio to Storage": {
"main": [
[
{
"node": "Twilio TwiML Response",
"type": "main",
"index": 0
}
]
]
},
"ElevenLabs Text-to-Speech": {
"main": [
[
{
"node": "Upload Audio to Storage",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 客服机器人, AI 聊天机器人
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
高级SEO、核心网页指标和聊天机器人自动化套件
使用GPT-4顾问、PageSpeed Insights和Slack提醒审核和监控SEO性能
If
Set
Cron
+12
22 节点Candra Reza
市场调研
航空公司常见问题解答机器人
使用GPT-4和问题分类自动化航空公司客户支持
If
Code
Merge
+4
27 节点Oneclick AI Squad
客服机器人
使用WhatsApp AI助手和Google文档及Gemini自动处理客户支持
使用WhatsApp AI助手和Google文档及Gemini自动处理客户支持
If
Code
Webhook
+9
14 节点Jamot
客服机器人
多渠道 DHL 状态机器人
用于网页表单和邮件查询的自动化 DHL 包裹追踪机器人
If
Code
Gmail
+6
15 节点Yusuke Yamamoto
客服机器人
对话式旅行预订器:使用 AI 自动化航班和酒店预订
对话式旅行预订器:使用 GPT-3.5 自动化航班和酒店预订
Code
Open Ai
Switch
+5
21 节点Oneclick AI Squad
客服机器人
个人预约预订
基于语音的预约预订系统,集成ElevenLabs AI和Cal.com
If
Webhook
Http Request
+1
5 节点InfyOm Technologies
客服机器人
工作流信息
难度等级
中级
节点数量10
分类2
节点类型7
作者
Shiva
@shivp1413Several years of Experience in AI, LLMs, Robotics, Electronics. I create N8N templates which are open-source and free!!
外部链接
在 n8n.io 查看 →
分享此工作流