https://retellai.com/?utm_source=discord&utm_medium=seo logo
"Getting this error when importing a conversation ...
# ❓・ai-evy-support
s
@AI Evy "Getting this error when importing a conversation flow agent JSON: 'failed to import agent configuration — cannot read properties of undefined (reading type)'. I've tried removing all server-generated fields, fixing tool types, cleaning variable names, and rebuilding from scratch. Still getting the same error. Can someone from the team tell me exactly which field is causing it?"
a
Thanks for tagging me @Shmoged. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, there's a known issue where importing conversation flow agents can fail with a "failed to get voice id" error when using custom voices [(1) ]() . This suggests the import process has strict validation requirements. When importing a conversation flow JSON, the system expects specific required fields in the correct format. According to the API documentation, the core required fields for creating a conversation flow include [(2) ]() : -
model_choice
(object with
model
and
type
properties) -
nodes
(array of node objects, each with
id
,
type
, and
instruction
properties) -
start_speaker
(enum: "user" or "agent") The error "cannot read properties of undefined (reading 'type') " suggests the import parser is trying to access a
type
property on an undefined object. This commonly occurs when: 1. **Node structure issues**: Each node must have a
type
field (e.g., "conversation", "function", etc.) 2. **Model choice configuration**: The
model_choice
object must include a
type
field (e.g., "cascading") 3. **Tool definitions**: If you have tools, each must have a
type
field (e.g., "custom") To troubleshoot, verify that every node in your
nodes
array has a properly defined
type
field, and that your
model_choice
object includes both
model
and
type
properties . If the issue persists after validation, I recommend reaching out to support through the [Documentation]() or [hiring a certified Retell partner]() for assistance with the specific JSON structure causing the error.
​ To learn more, see the sources I considered: [[1] Conversation Flow: Import / Upload JSON](https://discord.com/channels/1186424376300679209/1394595851942367252) [[2] 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.
s
i attached the file i tried to import
@AI Evy "Hi, I'm getting this error when trying to import a conversation flow agent JSON: 'failed to import agent configuration — cannot read properties of undefined (reading type)' I've already tried: Removing all server-generated fields (agent_id, version, is_published, last_modification_timestamp) Fixing variable names to remove {{ }} brackets Removing tool_type: local from function nodes Removing instruction from end nodes Changing language from multi to en-US and back Removing the voice_id entirely Rebuilding the JSON completely from scratch with only bare minimum fields Nothing has worked. Can someone tell me exactly which field or structure is causing this error? I'm happy to share the JSON file directly. The agent is a conversation flow with 7 nodes: Welcome, Info/Booking Intake, Check Availability (function), Collect Customer Info (extract_dynamic_variables), Book Appointment (function), Goodbye, and End Call. It uses two Cal.com tools." https://cdn.discordapp.com/attachments/1480750530107150346/1480752221611364362/Mazz_Barbershop_MINIMAL.json?ex=69b0d178&is=69af7ff8&hm=794fd6aa8a75561820d0147e783ffd1f120def0085905078eadae892c16c6339&
a
Thanks for the follow-up, @Shmoged. I'll get back to you soon.
### Answer The "cannot read properties of undefined (reading 'type') " error typically occurs when required fields are missing or improperly structured in your conversation flow JSON [(1) ]() . Based on the conversation flow structure requirements, verify these critical fields are present and correctly formatted : Required top-level fields: -
model_choice
- must include both
model
and
type
properties -
start_speaker
- must be either "user" or "agent" -
nodes
- array of node objects For each node in your nodes array, ensure: -
id
field is present -
type
field is present (e.g., "conversation", "function", "extract_dynamic_variables", "end_call") -
instruction
object with
type
and appropriate content For function nodes specifically: - Each edge must have a
transition_condition
with a
type
field - Tools referenced must have a
type
field (e.g., "custom") For your extract_dynamic_variables node: - Ensure the node structure includes the required
type
field Since you mentioned using Cal.com tools, verify each tool definition in your
tools
array has : -
type
field (typically "custom") -
name
field -
description
field The error suggests the parser is encountering an undefined object when trying to access its
type
property. Double-check that every object that should have a
type
field actually has one defined, particularly in your nodes array, model_choice object, and tools array . If you've verified all these fields and the issue persists, reach out through the [Documentation]() or [hire a certified Retell partner]() for direct assistance with your specific JSON structure.
​ 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.