alex_972140
08/21/2025, 6:05 AMAI Evy
08/21/2025, 6:05 AMAI Evy
08/21/2025, 6:05 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const conversationFlowResponse = await client.conversationFlow.create({
model_choice: { model: 'gpt-4o', type: 'cascading' },
nodes: [
{
id: 'start',
instruction: { text: 'Greet the customer and ask how you can help them.', type: 'prompt' },
type: 'conversation',
},
],
start_speaker: 'agent',
}) ;
## Node Structure and Transitions
Each conversation node should have specific instructions and edges with transition conditions [(1) ]() . Nodes are the building blocks of your conversation flow and are the steps that the agent will take to respond to the user . A node will have edges with transition conditions, that's what will be used to determine when and which node to transition to .
For example, you can structure nodes like this [(3) ]() :
json
[
{
"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"
}
]
}
]AI Evy
08/21/2025, 6:05 AMAI Evy
08/21/2025, 6:05 AMAI Evy
08/21/2025, 6:05 AM