https://retellai.com/?utm_source=discord&utm_medium=seo logo
how do i set up conversation nodes in the editor s...
# ❓・ai-evy-support
a
@AI Evy how do i set up conversation nodes in the editor so it will ask called multiple questions 1 by 1 question, cx answer, question, answer from cx etc... and then iforamation collecled from the customer to be sent to me via email api
a
Thanks for tagging me @alex_972140. I'll look through relevant sources and get back to you shortly.
### Answer To set up conversation nodes for collecting information step-by-step, you'll need to create a conversation flow with multiple conversation nodes that transition between each other [(1) ]() . ## Creating Sequential Conversation Nodes First, create a conversation flow with multiple nodes [(2) ]() :
Copy code
javascript
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) ]() :
Copy code
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"  
 }  
 ]  
 }  
]
## Ensuring Sequential Flow Based on a community discussion, to ensure your agent follows the proper node order and asks questions sequentially, you should [(4) ]() : 1. Create separate nodes for each piece of information you're collecting 2. Make the transitions more specific to only happen when the required information is received 3. Modify the global prompt so the agent's mission is to work through each node rather than just collect customer details 4. Add specific instructions in each node prompt about what not to ask for in that particular node ## Sending Information via Email API For sending the collected information via email, you'll need to use a Function Node [(5) ]() . Function nodes are used to call a function, whether it's a pre-built function or a custom function . You can add a custom function that sends the collected data to your email API . The function node can be configured to wait for the result and you can use dynamic variables to pass the collected information to your email function .
​ To learn more, see the sources I considered: [[1] Node Overview](https://docs.retellai.com/build/conversation-flow/node) [[2] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) [[3] Get Conversation Flow](https://docs.retellai.com/api-references/get-conversation-flow) [[4] Conversation Flow Agent Not Staying in Node Order](https://discord.com/channels/1186424376300679209/1356715885804392699) [[5] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.