|
| 1 | +# Plan: Retell AI to VAPI Migration Documentation |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This plan covers the creation of comprehensive documentation guiding users through converting Retell AI JSON conversation flow configurations to VAPI equivalents. The documentation targets users migrating from Retell AI's graph-based conversation flow system to VAPI's multi-assistant architecture. |
| 6 | + |
| 7 | +Both Retell AI and VAPI use graph-based architectures for conversation flows, making the conceptual mapping relatively straightforward. Retell uses nodes with instructions and edges with transition conditions, while VAPI offers two approaches: Squads (recommended, using handoff tools between assistants) and Workflows (deprecated, using node/edge graphs). The documentation will prioritize Squads as the recommended migration path while providing a legacy reference for Workflows. |
| 8 | + |
| 9 | +The documentation will live in the existing VapiAI/docs repository, following the Fern MDX documentation framework already in use. It will be placed in a new `fern/migration/` directory with a corresponding navigation section in `docs.yml`. |
| 10 | + |
| 11 | +## Goals |
| 12 | + |
| 13 | +- [ ] Primary: Create a clear, step-by-step migration guide that maps every Retell AI JSON configuration element to its VAPI equivalent |
| 14 | +- [ ] Secondary: Provide complete before/after conversion examples for common patterns (branching logic, variable extraction, multilingual support, tool calling) |
| 15 | +- [ ] Secondary: Recommend VAPI Squads as the primary migration path while documenting Workflows as a legacy alternative |
| 16 | +- [ ] Secondary: Integrate seamlessly into the existing Vapi documentation site navigation |
| 17 | + |
| 18 | +## Complexity |
| 19 | + |
| 20 | +**Assessment: Simple** |
| 21 | + |
| 22 | +This is a documentation-only change involving 4 new MDX files and 1 modified YAML file. No API endpoints, database changes, or service integrations are involved. Total files: 5 (4 create + 1 modify). All changes are content additions with no risk to existing functionality. |
| 23 | + |
| 24 | +## Technical Approach |
| 25 | + |
| 26 | +### Architecture |
| 27 | + |
| 28 | +The documentation will follow the existing Fern MDX framework patterns used throughout the VapiAI/docs repository. Content will be organized as a new top-level navigation section called "Migration guides" in `docs.yml`. |
| 29 | + |
| 30 | +Key architectural decisions: |
| 31 | +- **New directory `fern/migration/`**: Keeps migration content separate from feature documentation, following the pattern of `fern/workflows/`, `fern/squads/`, etc. |
| 32 | +- **Squads-first approach**: Since VAPI Workflows are deprecated, the Squads guide is the primary document while Workflows gets a shorter legacy reference |
| 33 | +- **Element mapping table**: A central reference table maps every Retell JSON property to both VAPI Squads and Workflows equivalents |
| 34 | +- **Progressive examples**: From simple (single node) to complex (multi-step interview with variable extraction) |
| 35 | + |
| 36 | +### Component Design |
| 37 | + |
| 38 | +**New files:** |
| 39 | +- `fern/migration/retell-overview.mdx` (~200-300 lines): Landing page with platform comparison, element mapping table, and decision guide |
| 40 | +- `fern/migration/retell-to-squads.mdx` (~350-450 lines): Primary 6-step migration guide with detailed instructions |
| 41 | +- `fern/migration/retell-to-workflows.mdx` (~150-250 lines): Legacy reference with deprecation notice |
| 42 | +- `fern/migration/retell-examples.mdx` (~300-400 lines): 5 complete before/after conversion examples |
| 43 | + |
| 44 | +**Modified files:** |
| 45 | +- `fern/docs.yml`: Add new "Migration guides" navigation section |
| 46 | + |
| 47 | +### Navigation Changes |
| 48 | + |
| 49 | +Add the following section to `docs.yml` at the top level, after the existing main sections: |
| 50 | + |
| 51 | +```yaml |
| 52 | +- section: Migration guides |
| 53 | + icon: fa-light fa-right-left |
| 54 | + contents: |
| 55 | + - page: Migrating from Retell AI |
| 56 | + path: migration/retell-overview.mdx |
| 57 | + icon: fa-light fa-arrow-right-arrow-left |
| 58 | + - page: "Retell to Squads (recommended)" |
| 59 | + path: migration/retell-to-squads.mdx |
| 60 | + icon: fa-light fa-people-group |
| 61 | + - page: "Retell to Workflows (legacy)" |
| 62 | + path: migration/retell-to-workflows.mdx |
| 63 | + icon: fa-light fa-diagram-project |
| 64 | + - page: Complete conversion examples |
| 65 | + path: migration/retell-examples.mdx |
| 66 | + icon: fa-light fa-code |
| 67 | +``` |
| 68 | +
|
| 69 | +### Element Mapping Reference |
| 70 | +
|
| 71 | +The core mapping table between platforms: |
| 72 | +
|
| 73 | +| Retell AI JSON Property | VAPI Squads Equivalent | VAPI Workflows Equivalent | |
| 74 | +|---|---|---| |
| 75 | +| `global_prompt` | System message in each assistant's `model.messages[]` | `globalNode.prompt` | |
| 76 | +| `start_node_id` | First member in `squad.members[]` | Node with `isStart: true` | |
| 77 | +| `nodes[].instruction.text` | `assistant.model.messages[].content` | `nodes[].systemPrompt` | |
| 78 | +| `nodes[].edges[]` | Handoff tool `destinations[]` | `edges[]` array | |
| 79 | +| `edges[].transition_condition` (type: "prompt") | Handoff tool `description` (natural language) | `edges[].condition` with `type: "ai"` | |
| 80 | +| `edges[].transition_condition` (type: "equation") | Handoff rejection plan conditions | `edges[].condition` with `type: "logic"` | |
| 81 | +| `edges[].destination_node_id` | `destinations[].assistantId` | `edges[].to` | |
| 82 | +| `model_temperature` | `assistant.model.temperature` | `nodes[].model.temperature` | |
| 83 | +| `tools[]` | `assistant.model.tools[]` | `nodes[].tools[]` | |
| 84 | +| `knowledge_base_ids` | `assistant.model.knowledgeBase` | N/A | |
| 85 | +| N/A (manual) | `variableExtractionPlan` with JSON schema | `extractVariables` | |
| 86 | +| N/A | `contextEngineeringPlan` | N/A | |
| 87 | + |
| 88 | +## Implementation Steps |
| 89 | + |
| 90 | +### Step 1: Create retell-overview.mdx (Landing Page) |
| 91 | + |
| 92 | +**Files:** |
| 93 | +- Create: `fern/migration/retell-overview.mdx` |
| 94 | + |
| 95 | +**Description:** |
| 96 | +Create the migration landing page that serves as the entry point for Retell AI users. This page should include: |
| 97 | + |
| 98 | +1. **Introduction** (~30 lines): Welcome message for Retell users, brief explanation of VAPI's capabilities, and note that VAPI Squads is the recommended migration path |
| 99 | +2. **Platform Comparison** (~40 lines): Side-by-side comparison of Retell AI and VAPI architectures: |
| 100 | + - Retell: Nodes with instructions + edges with transition conditions |
| 101 | + - VAPI Squads: Multiple assistants with handoff tools |
| 102 | + - VAPI Workflows: Node/edge graph (deprecated) |
| 103 | +3. **Element Mapping Table** (~50 lines): The complete mapping table from the Technical Approach section above |
| 104 | +4. **Migration Path Decision Guide** (~30 lines): Help users choose between Squads (recommended for new migrations) and Workflows (only if specific legacy requirements exist) |
| 105 | +5. **Prerequisites** (~20 lines): What users need before starting (VAPI account, API key, Retell JSON export) |
| 106 | +6. **Quick Start** (~30 lines): Links to the detailed guides with brief descriptions |
| 107 | + |
| 108 | +**Testing:** |
| 109 | +- Verify MDX renders correctly in Fern preview |
| 110 | +- Verify all internal links resolve |
| 111 | +- Verify mapping table is accurate against both platforms' current APIs |
| 112 | + |
| 113 | +**Dependencies:** None |
| 114 | + |
| 115 | +### Step 2: Create retell-to-squads.mdx (Primary Guide) |
| 116 | + |
| 117 | +**Files:** |
| 118 | +- Create: `fern/migration/retell-to-squads.mdx` |
| 119 | + |
| 120 | +**Description:** |
| 121 | +Create the primary migration guide using VAPI Squads. This is the most important document and should be comprehensive. Structure as a 6-step process: |
| 122 | + |
| 123 | +1. **Step 1: Analyze Your Retell Configuration** (~50 lines) |
| 124 | + - How to export/examine your Retell JSON |
| 125 | + - Identify nodes, edges, global prompt, tools, and variables |
| 126 | + - Count conversation stages for squad member planning |
| 127 | + |
| 128 | +2. **Step 2: Map Nodes to Assistants** (~80 lines) |
| 129 | + - Each Retell node becomes a VAPI assistant (squad member) |
| 130 | + - Convert `nodes[].instruction.text` to `assistant.model.messages[].content` |
| 131 | + - Map `global_prompt` to system messages in each assistant |
| 132 | + - Configure `model.temperature` from Retell's `model_temperature` |
| 133 | + - Show JSON before/after for a single node conversion |
| 134 | + |
| 135 | +3. **Step 3: Configure Handoff Tools (Transition Logic)** (~80 lines) |
| 136 | + - Convert Retell `edges[]` to handoff tool `destinations[]` |
| 137 | + - Map `transition_condition.type: "prompt"` to handoff `description` |
| 138 | + - Map `transition_condition.type: "equation"` to rejection plan conditions |
| 139 | + - Map `destination_node_id` to `assistantId` in destinations |
| 140 | + - Show JSON before/after for edge conversion |
| 141 | + |
| 142 | +4. **Step 4: Set Up Variable Extraction** (~60 lines) |
| 143 | + - Use `variableExtractionPlan` with JSON schema to capture structured data |
| 144 | + - Map Retell's manual variable handling to VAPI's automatic extraction |
| 145 | + - Configure `aliases` using Liquid templates for cross-assistant data sharing |
| 146 | + - Show example for extracting name, age, location from conversation |
| 147 | + |
| 148 | +5. **Step 5: Configure Context Engineering** (~40 lines) |
| 149 | + - Set `contextEngineeringPlan` for each handoff (all/lastNMessages/userAndAssistantMessages/none) |
| 150 | + - Best practices for long interviews: use `lastNMessages` to avoid context overflow |
| 151 | + - How context flows between squad members during handoffs |
| 152 | + |
| 153 | +6. **Step 6: Assemble the Squad** (~60 lines) |
| 154 | + - Combine all assistants into a squad via API |
| 155 | + - Set the first member (maps to `start_node_id`) |
| 156 | + - Configure squad-level settings |
| 157 | + - Show complete squad creation API call |
| 158 | + - Testing and validation checklist |
| 159 | + |
| 160 | +**Testing:** |
| 161 | +- All JSON examples must be valid and match current VAPI API schema |
| 162 | +- Step-by-step flow should be followable by a developer with no prior VAPI experience |
| 163 | +- Cross-reference handoff configuration against `fern/squads/handoff.mdx` |
| 164 | + |
| 165 | +**Dependencies:** Step 1 (overview page for cross-linking) |
| 166 | + |
| 167 | +### Step 3: Create retell-to-workflows.mdx (Legacy Reference) |
| 168 | + |
| 169 | +**Files:** |
| 170 | +- Create: `fern/migration/retell-to-workflows.mdx` |
| 171 | + |
| 172 | +**Description:** |
| 173 | +Create a shorter legacy reference for users who specifically need Workflows. Include a prominent deprecation notice at the top. |
| 174 | + |
| 175 | +1. **Deprecation Notice** (~10 lines): Clear callout that Workflows are deprecated, link to Squads guide as recommended alternative |
| 176 | +2. **When to Use Workflows** (~20 lines): Only if you have specific requirements that Squads cannot meet (increasingly rare) |
| 177 | +3. **Quick Mapping Guide** (~60 lines): |
| 178 | + - `start_node_id` → node with `isStart: true` |
| 179 | + - `global_prompt` → `globalNode.prompt` |
| 180 | + - `nodes[].instruction.text` → `nodes[].systemPrompt` |
| 181 | + - `edges[].transition_condition` → `edges[].condition` (ai/logic types) |
| 182 | + - `tools[]` → `nodes[].tools[]` |
| 183 | +4. **Simple Conversion Example** (~60 lines): One complete before/after example |
| 184 | +5. **Limitations vs Squads** (~30 lines): What you miss by using Workflows (variable extraction, context engineering, etc.) |
| 185 | + |
| 186 | +**Testing:** |
| 187 | +- Deprecation notice must be visually prominent |
| 188 | +- JSON examples must match current Workflows API schema |
| 189 | +- Cross-reference against `fern/workflows/overview.mdx` and `fern/workflows/quickstart.mdx` |
| 190 | + |
| 191 | +**Dependencies:** Step 1 (overview page for cross-linking) |
| 192 | + |
| 193 | +### Step 4: Create retell-examples.mdx (Complete Examples) |
| 194 | + |
| 195 | +**Files:** |
| 196 | +- Create: `fern/migration/retell-examples.mdx` |
| 197 | + |
| 198 | +**Description:** |
| 199 | +Create a page with 5 complete before/after conversion examples, progressing from simple to complex: |
| 200 | + |
| 201 | +1. **Example 1: Simple Greeting + Transfer** (~50 lines) |
| 202 | + - Retell: 2 nodes (greeting → transfer) |
| 203 | + - VAPI Squad: 2 assistants with one handoff |
| 204 | + |
| 205 | +2. **Example 2: Branching Logic (FAQ Bot)** (~60 lines) |
| 206 | + - Retell: 1 node with 3 conditional edges |
| 207 | + - VAPI Squad: 1 assistant with 3 handoff destinations |
| 208 | + |
| 209 | +3. **Example 3: Data Collection with Variable Extraction** (~70 lines) |
| 210 | + - Retell: 3 nodes collecting name, email, phone |
| 211 | + - VAPI Squad: 3 assistants with variableExtractionPlan |
| 212 | + |
| 213 | +4. **Example 4: Multilingual Support (English + Swahili)** (~60 lines) |
| 214 | + - Retell: Language detection node → language-specific branches |
| 215 | + - VAPI Squad: Language detector assistant → language-specific assistants with appropriate voice/model config |
| 216 | + |
| 217 | +5. **Example 5: Complex Interview Flow** (~80 lines) |
| 218 | + - Retell: 5+ nodes with conditional branching, tool calls, and data collection |
| 219 | + - VAPI Squad: Full squad with context engineering, variable extraction, tools, and handoff chains |
| 220 | + - Includes contextEngineeringPlan configuration for long conversations |
| 221 | + |
| 222 | +Each example includes: |
| 223 | +- Complete Retell JSON input |
| 224 | +- Complete VAPI Squad JSON output |
| 225 | +- Brief explanation of the mapping decisions |
| 226 | + |
| 227 | +**Testing:** |
| 228 | +- All Retell JSON examples must follow the documented Retell format |
| 229 | +- All VAPI JSON examples must be valid against current API schema |
| 230 | +- Examples should be copy-pasteable (with minor edits for API keys/IDs) |
| 231 | + |
| 232 | +**Dependencies:** Steps 1-3 (for cross-linking) |
| 233 | + |
| 234 | +### Step 5: Update docs.yml Navigation |
| 235 | + |
| 236 | +**Files:** |
| 237 | +- Modify: `fern/docs.yml` |
| 238 | + |
| 239 | +**Description:** |
| 240 | +Add the "Migration guides" navigation section to `docs.yml`. Place it after the main feature documentation sections. The section should include all 4 migration pages with appropriate icons. |
| 241 | + |
| 242 | +The exact YAML to add is specified in the Navigation Changes section above. Place it after the "Phone numbers" section and before "Server URLs" (or a similarly appropriate location near the end of the main navigation). |
| 243 | + |
| 244 | +**Testing:** |
| 245 | +- Verify YAML is valid (no syntax errors) |
| 246 | +- Verify all `path:` values match actual file locations |
| 247 | +- Verify navigation renders correctly in Fern preview |
| 248 | +- Verify icons display properly |
| 249 | + |
| 250 | +**Dependencies:** Steps 1-4 (all MDX files must exist) |
| 251 | + |
| 252 | +## PR Strategy |
| 253 | + |
| 254 | +Due to the 500-line PR limit enforced by tasker guardrails, the implementation will be split across 2-3 PRs: |
| 255 | + |
| 256 | +- **PR 1** (~400-500 lines): `retell-overview.mdx` + `retell-to-workflows.mdx` + `docs.yml` changes |
| 257 | +- **PR 2** (~350-450 lines): `retell-to-squads.mdx` |
| 258 | +- **PR 3** (~300-400 lines): `retell-examples.mdx` |
| 259 | + |
| 260 | +Each PR should be independently reviewable and mergeable. PR 1 includes the `docs.yml` changes so navigation is available from the first merge. |
| 261 | + |
| 262 | +## Testing Strategy |
| 263 | + |
| 264 | +**Content validation:** |
| 265 | +- All JSON examples are syntactically valid |
| 266 | +- All Retell JSON follows documented Retell format |
| 267 | +- All VAPI JSON matches current VAPI API schema |
| 268 | +- Element mapping table is accurate and complete |
| 269 | + |
| 270 | +**Documentation quality:** |
| 271 | +- MDX renders correctly in Fern framework |
| 272 | +- All internal cross-links resolve |
| 273 | +- Code blocks have correct language tags |
| 274 | +- Callouts and admonitions render properly |
| 275 | + |
| 276 | +**User experience:** |
| 277 | +- A developer unfamiliar with VAPI can follow the Squads guide end-to-end |
| 278 | +- Examples are copy-pasteable with minimal modification |
| 279 | +- Navigation is intuitive and discoverable |
| 280 | + |
| 281 | +**Edge cases:** |
| 282 | +- Retell configurations with no edges (single-node flows) |
| 283 | +- Retell configurations with circular/looping edges |
| 284 | +- Retell configurations using knowledge bases (partial VAPI mapping) |
| 285 | +- Very large Retell configs (20+ nodes) — address with context engineering guidance |
| 286 | + |
| 287 | +## Risks & Mitigations |
| 288 | + |
| 289 | +| Risk | Likelihood | Impact | Mitigation | |
| 290 | +|---|---|---|---| |
| 291 | +| Retell AI JSON format changes | Low | Medium | Document the format version; note that examples are based on current Retell format | |
| 292 | +| VAPI Workflows fully removed | Medium | Low | Workflows guide already marked as legacy; Squads guide is primary | |
| 293 | +| VAPI Squads API changes | Low | Medium | Use current API schema; document API version | |
| 294 | +| 500-line PR limit exceeded | Medium | Low | Pre-planned PR split strategy; monitor line counts during implementation | |
| 295 | +| Retell format documentation gaps | Medium | Medium | Used real Retell configs and code search to verify format; note any assumptions | |
| 296 | + |
| 297 | +## Dependencies |
| 298 | + |
| 299 | +**External documentation:** |
| 300 | +- Retell AI JSON conversation flow format (verified via code search and real configs) |
| 301 | +- VAPI Squads API documentation (`fern/squads/handoff.mdx`) |
| 302 | +- VAPI Workflows API documentation (`fern/workflows/overview.mdx`, `fern/workflows/quickstart.mdx`) |
| 303 | + |
| 304 | +**Internal prerequisites:** |
| 305 | +- VapiAI/docs repository access |
| 306 | +- Fern framework MDX rendering pipeline |
| 307 | + |
| 308 | +## Success Criteria |
| 309 | + |
| 310 | +- [ ] All 4 MDX files created and rendering correctly in Fern |
| 311 | +- [ ] Navigation section added to docs.yml and functional |
| 312 | +- [ ] Element mapping table covers all major Retell JSON properties |
| 313 | +- [ ] At least 5 complete before/after conversion examples provided |
| 314 | +- [ ] Squads guide is clearly positioned as the recommended migration path |
| 315 | +- [ ] Workflows guide includes prominent deprecation notice |
| 316 | +- [ ] All JSON examples are syntactically valid |
| 317 | +- [ ] A developer can follow the Squads guide to convert a real Retell config |
| 318 | +- [ ] Documentation is general enough for any Retell user (not project-specific) |
0 commit comments