sahalshamas
12/04/2025, 4:33 PMAI Evy
12/04/2025, 4:33 PMAI Evy
12/04/2025, 4:33 PMjavascript
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',
}) ;
Key Components:
- **Nodes**: Define different scenarios in your conversation [(1) ]()
- **Edges**: Connect nodes with transition conditions
- **Global Settings**: Configuration that applies to the entire conversation
Feel free to share your script, and I can help you understand how to structure it into nodes and transitions for your conversation flow agent.
**AI Evy
12/04/2025, 4:33 PMAI Evy
12/04/2025, 4:33 PMsahalshamas
12/04/2025, 5:28 PMAI Evy
12/04/2025, 5:28 PMAI Evy
12/04/2025, 5:29 PMAI Evy
12/04/2025, 5:29 PMAI Evy
12/04/2025, 5:29 PMsahalshamas
12/04/2025, 5:30 PMAI Evy
12/04/2025, 5:30 PMAI Evy
12/04/2025, 5:30 PM{{staff_name}} and {{owner_name}} [(2) ]()
- You have clear transition logic between nodes [(1) ]()
What Needs Adjustment:
1. **Node Structure**: Each section should be a Conversation Node with proper instruction formatting [(3) ]() . Conversation nodes support either a Prompt (for dynamic generation) or Static Sentence (for fixed text) .
2. **Transitions**: Instead of "Example transitions," you need to define Edges with transition conditions [(1) ]() . Edges connect nodes and define how conversations progress based on user interactions .
3. **Dynamic Variables**: While you can use variables like {{staff_name}}, you'll need to capture these values through function calls or set them as dynamic variables in your flow [(2) ]() .
4. **Conditional Logic**: For the Role_Identify node where you branch based on user response (owner vs staff) , you'll need separate edges with prompt-based transition conditions [(3) ]() .
Recommended Structure:
Create three conversation nodes:
- Rapport_AskName node with your greeting prompt
- Offer_Presentation node with your pitch
- Role_Identify node with your role question
Then connect them with edgeAI Evy
12/04/2025, 5:30 PMAI Evy
12/04/2025, 5:30 PMsahalshamas
12/04/2025, 5:34 PMAI Evy
12/04/2025, 5:34 PMAI Evy
12/04/2025, 5:34 PMAI Evy
12/04/2025, 5:34 PMInstruction Type: Prompt
Text: "Hi! I'm Stella from Table Waiterr. Before we continue, I'd love to know your name - what should I call you?"
Node 2: Offer_Presentation (Conversation Node)
Instruction Type: Prompt
Text: "Thanks, {{staff_name}}! I'm reaching out from Table Waiterr. We help restaurants like yours convert printed menus into interactive QR-code menus that customers can scan right from their tables or at your entrance. We also promote these Scan-to-Order QR menus on Facebook, Instagram, and Google to drive more foot traffic. Customers can browse your menu, order, and pay directly from their phones - no app download needed."
Node 3: Role_Identify (Conversation Node)
Instruction Type: Prompt
Text: "Quick question - are you the owner or manager of the restaurant, or are you part of the team here?"AI Evy
12/04/2025, 5:34 PMAI Evy
12/04/2025, 5:34 PMsahalshamas
12/04/2025, 5:37 PMAI Evy
12/04/2025, 5:37 PMAI Evy
12/04/2025, 5:37 PMAI Evy
12/04/2025, 5:37 PMAI Evy
12/04/2025, 5:37 PM