marvin_17392
11/11/2025, 3:25 AMAI Evy
11/11/2025, 3:25 AMAI Evy
11/11/2025, 3:26 AMAI Evy
11/11/2025, 3:26 AMAI Evy
11/11/2025, 3:26 AMmarvin_17392
11/11/2025, 4:38 AMmarvin_17392
11/11/2025, 4:38 AMAI Evy
11/11/2025, 4:38 AMAI Evy
11/11/2025, 4:39 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-5', type: 'cascading' },
nodes: [
{
id: 'start',
instruction: { text: 'Greet the customer and ask how you can help them.', type: 'prompt' },
type: 'conversation',
},
],
start_speaker: 'agent',
}) ;
console.log(conversationFlowResponse.conversation_flow_id) ;
[(1) ]()
2. Create an Agent and Attach the Conversation Flow as the Response Engine
Use the conversation_flow_id from the previous step as the response engine when creating the agent:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
response_engine: { llm_id: conversationFlowResponse.conversation_flow_id, type: 'conversation-flow' },
voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
[(2) ]() , [(3) ]()
- First, create the conversation flow to get the conversation_flow_id.
- Then, create the agent and use that conversation_flow_id as the response_engine.
For more details, see [Create Conversation Flow]() and [Create Agent]() .AI Evy
11/11/2025, 4:44 AMAI Evy
11/11/2025, 4:44 AM