https://retellai.com/?utm_source=discord&utm_medium=seo logo
Cannot read properties of undefined (reading 'type...
# ❓・ai-evy-support
r
@AI Evy Cannot read properties of undefined (reading 'type') when i am trying to import a json for conversational flow agent, why would this be
a
Thanks for tagging me @reetam5807. I'll look through relevant sources and get back to you shortly.
### Answer The "Cannot read properties of undefined (reading 'type') " error when importing JSON for a conversation flow agent typically indicates a schema validation issue [(1) ]() . This happens when the JSON payload doesn't match the expected structure . Common causes include: 1. Missing required fields - The conversation flow JSON requires specific fields like
model_choice
with a
type
property [(2) ]() [(3) ]() . Ensure your JSON includes: -
model_choice
object with
type
field (e.g., "cascading") -
nodes
array with properly structured node objects -
start_speaker
field 2. Invalid JSON syntax - Check for trailing commas, incorrect syntax, or malformed structure [(1) ]() . The JSON must be valid . 3. Missing nested properties - Each node requires specific properties like
id
,
type
, and
instruction
with its own
type
field [(2) ]() [(3) ]() . To resolve this: - Verify all required fields are present and properly formatted [(1) ]() - Ensure the
name
,
tool_id
, and
url
are properly formatted if using custom functions - Validate your JSON structure matches the schema shown in the API documentation [(2) ]() [(3) ]() If you can share your JSON (without secrets) , the specific schema mismatch can be identified [(1) ](
els/1186424376300679209/1411008678487916646) .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] 400 error when adding a function to a conversation flow](https://discord.com/channels/1186424376300679209/1411008678487916646) [[2] Get Conversation Flow](https://docs.retellai.com/api-references/get-conversation-flow) [[3] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) ​