https://retellai.com/?utm_source=discord&utm_medium=seo logo
'm trying to import a conversation flow JSON file ...
# 💬・general
j
@AI Evy 'm trying to import a conversation flow JSON file but getting an error. What fields are required/supported for conversation flow imports? I have: nodes, global_prompt, start_node_id, and tools. Is there a specific JSON structure example you can share?" Does the import feature support all node types including branch nodes with instruction properties?
a
Thanks for tagging me @jrok1308. I'll look through relevant sources and get back to you shortly.
### Answer Based on the documentation, here are the required and supported fields for conversation flow imports: ## Required Fields The conversation flow structure requires these core fields [(1) ]() : -
start_speaker
- Who starts the conversation (user or agent) -
model_choice
- The model configuration including type, model, and high_priority settings -
nodes
- Array of nodes in the conversation flow ## Supported Optional Fields Additional supported fields include : -
global_prompt
- Global prompt used in every node -
tools
- Tools available in the conversation flow -
components
- Local components embedded within the flow -
start_node_id
- ID of the start node -
model_temperature
- Controls response randomness (0-1 range) -
tool_call_strict_mode
- Whether to use strict mode for tool calls -
default_dynamic_variables
- Default dynamic variables for the flow -
knowledge_base_ids
- Knowledge base IDs for RAG -
kb_config
- Knowledge base configuration -
begin_tag_display_position
- Display position for the begin tag -
mcps
- MCP server configurations -
begin_after_user_silence_ms
- Duration before AI begins after user silence ## Example Structure Here's the documented structure :
Copy code
json
{
  "start_speaker": "agent",
  "model_choice": {
    "type": "cascading",
    "model": "gpt-5",
    "high_priority": true
  },
  "nodes": [
    {
      "id": "start",
      "type": "conversation",
      "instruction": {
        "type": "prompt",
        "text": "Greet the customer and ask how you can help them."
      },
      "edges": [
        {
          "id": "edge_1",
          "transition_condition": {
            "type": "prompt",
            "prompt": "Customer wants to book appointment"
          },
          "destination_node_id": "book_appointment"
        }
      ]
    }
  ]
}
The documentation shows that nodes can have various types including conversation nodes with instruction properties . Branch nodes would follow similar patterns with edges defining transition conditions . If you're still experiencing import errors, please verify that your
start_speaker
and
model_choice
fields are properly formatted, as these are required fields .
​ To learn more, see the sources I considered: [[1] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy What is the correct API endpoint to UPDATE an existing conversation flow? I have: - Flow ID: conversation_flow_b356dff195fd - Agent ID: agent_df0aa9085aef21fbf2c4ad52a1 I want to update the nodes, global_prompt, and tools in the existing flow. What HTTP method (PATCH/PUT) and exact endpoint URL should I use? Also, what is the correct request body structure?
a
Thanks for the follow-up, @jrok1308. I'll get back to you soon.
### Answer To update an existing conversation flow, use the PATCH method with the endpoint
/update-conversation-flow/{conversation_flow_id}
[(1) ]() . ## Endpoint Details For your specific flow ID, the endpoint would be :
Copy code
PATCH /update-conversation-flow/conversation_flow_b356dff195fd
## Request Body Structure You can update the
nodes
,
global_prompt
, and
tools
fields . Here's the structure:
Copy code
json
{
  "global_prompt": "You are a helpful customer service agent.",
  "tools": [
    {
      "type": "custom",
      "name": "get_customer_info",
      "description": "Get customer information from database",
      "tool_id": "tool_001",
      "url": "<https://api.example.com/customer%22,>
      "method": "GET"
    }
  ],
  "nodes": [
    {
      "id": "start",
      "type": "conversation",
      "instruction": {
        "type": "prompt",
        "text": "Greet the customer and ask how you can help them."
      },
      "edges": [
        {
          "id": "edge_1",
          "transition_condition": {
            "type": "prompt",
            "prompt": "Customer wants to book appointment"
          },
          "destination_node_id": "book_appointment"
        }
      ]
    }
  ]
}
## SDK Example Using the Retell SDK :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const conversationFlowResponse = await client.conversationFlow.update('conversation_flow_id') ;
console.log(conversationFlowResponse.conversation_flow_id) ;
The agent ID you mentioned is separate from the conversation flow ID - you don't need to include it in the update request .
​ To learn more, see the sources I considered: [[1] Update Conversation Flow](https://docs.retellai.com/api-references/update-conversation-flow) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.