create-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVapi Workflow Creation
Vapi 工作流创建
Build structured conversation workflows with visual node-based flows. Workflows provide deterministic control over conversation steps, branching logic, and tool execution.
Setup: Ensureis set. See theVAPI_API_KEYskill if needed.setup-api-key
借助可视化节点流构建结构化对话工作流。工作流可为对话步骤、分支逻辑和工具执行提供确定性控制。
设置: 确保已配置。如有需要可参考VAPI_API_KEYskill。setup-api-key
When to Use Workflows vs Assistants
工作流与助手的适用场景对比
| Feature | Assistant | Workflow |
|---|---|---|
| Simple conversations | Best choice | Over-engineered |
| Multi-step processes | Can work with good prompting | Best choice |
| Deterministic flow | Hard to guarantee | Built-in |
| Conditional branching | Prompt-dependent | Visual nodes |
| Complex state management | Difficult | Native support |
| 功能 | 助手 | 工作流 |
|---|---|---|
| 简单对话 | 最优选择 | 过度设计 |
| 多步流程 | 提示词编写得当也可实现 | 最优选择 |
| 确定性流程 | 难以保证 | 原生支持 |
| 条件分支 | 依赖提示词实现 | 可视化节点配置 |
| 复杂状态管理 | 实现难度高 | 原生支持 |
Quick Start
快速开始
Workflows are best built in the Vapi Dashboard visual editor at https://dashboard.vapi.ai — but they can also be configured via API.
工作流最适合在 Vapi Dashboard 可视化编辑器中搭建,访问地址为 https://dashboard.vapi.ai —— 你也可以通过API进行配置。
Dashboard Workflow
仪表板创建工作流
- Go to https://dashboard.vapi.ai
- Navigate to Workflows
- Click Create Workflow
- Add nodes: Conversation, Tool, Condition, Handoff
- Connect nodes to define the flow
- Publish and attach to a phone number or call
- 访问 https://dashboard.vapi.ai
- 进入 Workflows 页面
- 点击 Create Workflow
- 添加节点:对话、工具、条件、转接
- 连接节点定义流程走向
- 发布后绑定到手机号或通话中使用
Using a Workflow in a Call
通话中使用工作流
bash
curl -X POST https://api.vapi.ai/call \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflowId": "your-workflow-id",
"phoneNumberId": "your-phone-number-id",
"customer": {
"number": "+11234567890"
}
}'bash
curl -X POST https://api.vapi.ai/call \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflowId": "your-workflow-id",
"phoneNumberId": "your-phone-number-id",
"customer": {
"number": "+11234567890"
}
}'Node Types
节点类型
Conversation Node
对话节点
The core building block — the assistant has a conversation within defined boundaries:
- System prompt specific to this step
- Model and voice configuration
- Exit conditions that trigger transitions to other nodes
- Variables to extract and pass between nodes
核心构建模块——助手在定义的边界内开展对话:
- 对应步骤专属的系统提示词
- 模型和音色配置
- 触发跳转到其他节点的退出条件
- 可提取并在节点间传递的变量
Tool Node
工具节点
Execute a tool (API call, function) and use the result in subsequent nodes.
执行工具(API调用、函数)并将结果用于后续节点。
Condition Node
条件节点
Branch the flow based on variables or conversation state.
基于变量或对话状态分支流程走向。
Handoff Node
转接节点
Transfer to another workflow, assistant, or phone number.
将对话转接到其他工作流、助手或手机号。
Workflow Patterns
工作流模式
Appointment Scheduling Flow
预约排期流
[Greeting] → [Collect Date] → [Check Availability (Tool)] → [Confirm Booking] → [Goodbye]
↓ (unavailable)
[Suggest Alternatives] → [Confirm Booking][问候] → [收集日期] → [检查可用性(工具)] → [确认预约] → [结束]
↓(无可用时段)
[推荐替代时段] → [确认预约]Lead Qualification Flow
线索资质判断流
[Introduction] → [Ask Budget] → [Ask Timeline] → [Qualify (Condition)]
↓ (qualified)
[Schedule Demo]
↓ (not qualified)
[Send Resources][自我介绍] → [询问预算] → [询问时间规划] → [资质判断(条件)]
↓(符合要求)
[预约演示]
↓(不符合要求)
[发送相关资源]Support Triage Flow
客服分流流
[Greeting] → [Identify Issue (Condition)]
↓ (billing) ↓ (technical) ↓ (other)
[Billing Flow] [Tech Support Flow] [General Help][问候] → [识别问题类型(条件)]
↓(账单问题) ↓(技术问题) ↓(其他问题)
[账单处理流] [技术支持流] [常规帮助]Attaching Workflows
绑定工作流
To a Phone Number
绑定到手机号
bash
curl -X PATCH https://api.vapi.ai/phone-number/{id} \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflowId": "your-workflow-id"
}'bash
curl -X PATCH https://api.vapi.ai/phone-number/{id} \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflowId": "your-workflow-id"
}'In an Outbound Call
外呼时使用
bash
curl -X POST https://api.vapi.ai/call \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflowId": "your-workflow-id",
"phoneNumberId": "your-phone-number-id",
"customer": { "number": "+11234567890" }
}'bash
curl -X POST https://api.vapi.ai/call \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflowId": "your-workflow-id",
"phoneNumberId": "your-phone-number-id",
"customer": { "number": "+11234567890" }
}'References
参考资料
- Vapi Workflows Docs — Official guide
- Workflow Examples — Common patterns
- Vapi 工作流文档 —— 官方指南
- 工作流示例 —— 通用模式
Additional Resources
额外资源
This skills repository includes a Vapi documentation MCP server () that gives your AI agent access to the full Vapi knowledge base. Use the tool to look up anything beyond what this skill covers — advanced configuration, troubleshooting, SDK details, and more.
vapi-docssearchDocsAuto-configured: If you cloned or installed these skills, the MCP server is already configured via (Claude Code), (Cursor), or (VS Code Copilot).
.mcp.json.cursor/mcp.json.vscode/mcp.jsonManual setup: If your agent doesn't auto-detect the config, run:
bash
claude mcp add vapi-docs -- npx -y mcp-remote https://docs.vapi.ai/_mcp/serverSee the README for full setup instructions across all supported agents.
本技能仓库包含一个 Vapi 文档 MCP 服务器(),可让你的AI Agent访问完整的Vapi知识库。如果需要查询本skill未覆盖的内容,可使用工具查找高级配置、故障排查、SDK详情等信息。
vapi-docssearchDocs自动配置: 如果你克隆或安装了这些技能,MCP服务器已经通过(Claude Code)、(Cursor)或(VS Code Copilot)完成配置。
.mcp.json.cursor/mcp.json.vscode/mcp.json手动设置: 如果你的Agent没有自动识别到配置,可执行:
bash
claude mcp add vapi-docs -- npx -y mcp-remote https://docs.vapi.ai/_mcp/server查看README获取所有支持的Agent的完整设置说明。