create-workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Vapi 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: Ensure
VAPI_API_KEY
is set. See the
setup-api-key
skill if needed.
借助可视化节点流构建结构化对话工作流。工作流可为对话步骤、分支逻辑和工具执行提供确定性控制。
设置: 确保已配置
VAPI_API_KEY
。如有需要可参考
setup-api-key
skill。

When to Use Workflows vs Assistants

工作流与助手的适用场景对比

FeatureAssistantWorkflow
Simple conversationsBest choiceOver-engineered
Multi-step processesCan work with good promptingBest choice
Deterministic flowHard to guaranteeBuilt-in
Conditional branchingPrompt-dependentVisual nodes
Complex state managementDifficultNative 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

仪表板创建工作流

  1. Go to https://dashboard.vapi.ai
  2. Navigate to Workflows
  3. Click Create Workflow
  4. Add nodes: Conversation, Tool, Condition, Handoff
  5. Connect nodes to define the flow
  6. Publish and attach to a phone number or call
  1. 访问 https://dashboard.vapi.ai
  2. 进入 Workflows 页面
  3. 点击 Create Workflow
  4. 添加节点:对话、工具、条件、转接
  5. 连接节点定义流程走向
  6. 发布后绑定到手机号或通话中使用

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

参考资料

Additional Resources

额外资源

This skills repository includes a Vapi documentation MCP server (
vapi-docs
) that gives your AI agent access to the full Vapi knowledge base. Use the
searchDocs
tool to look up anything beyond what this skill covers — advanced configuration, troubleshooting, SDK details, and more.
Auto-configured: If you cloned or installed these skills, the MCP server is already configured via
.mcp.json
(Claude Code),
.cursor/mcp.json
(Cursor), or
.vscode/mcp.json
(VS Code Copilot).
Manual 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/server
See the README for full setup instructions across all supported agents.
本技能仓库包含一个 Vapi 文档 MCP 服务器
vapi-docs
),可让你的AI Agent访问完整的Vapi知识库。如果需要查询本skill未覆盖的内容,可使用
searchDocs
工具查找高级配置、故障排查、SDK详情等信息。
自动配置: 如果你克隆或安装了这些技能,MCP服务器已经通过
.mcp.json
(Claude Code)、
.cursor/mcp.json
(Cursor)或
.vscode/mcp.json
(VS Code Copilot)完成配置。
手动设置: 如果你的Agent没有自动识别到配置,可执行:
bash
claude mcp add vapi-docs -- npx -y mcp-remote https://docs.vapi.ai/_mcp/server
查看README获取所有支持的Agent的完整设置说明。