https://retellai.com/?utm_source=discord&utm_medium=seo logo
is it possible to have a conditional script
# ❓・ai-evy-support
m
@AI Evy is it possible to have a conditional script?
a
Thanks for tagging me @mehxbot. I'll look through relevant sources and get back to you shortly.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer Yes, it is possible to have conditional logic in Retell AI using the Logic Split Node. The Logic Split Node allows you to create conditional branches in your conversation flow based on variables, so you can direct the agent to different paths depending on specific conditions [(1) ]() . If you need to check whether a variable exists or has a certain value before proceeding, you can use a "hydration guard" (e.g., check if the variable exists or is not empty) to ensure the condition is evaluated properly [(2) ]() .
​ To learn more, see the sources I considered: [[1] Node Overview](https://docs.retellai.com/build/conversation-flow/node) [[2] Logic Split Node Equation Not Working As Expected](https://discord.com/channels/1186424376300679209/1406310248691667125) ​
m
@AI Evy what type of agent is this node in?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer The Logic Split Node is used within a Conversation Flow Agent in Retell AI. Conversation Flow Agents are designed for multi-step, logic-driven interactions with branching paths and decision trees, and nodes like the Logic Split Node are part of building these flows [(1) ]() . This node type is not available in other agent types such as Single Prompt Agents or Multi-Prompt Agents .
​ To learn more, see the sources I considered: [[1] Inside Retell AI | The Conversational AI Platform Behind Scalable AI Phone Systems | Retell AI](https://www.retellai.com/blog/inside-retell-ai-conversational-ai-phone-system) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
m
@AI Evy in multi prompt agent how do I set the edge, I am unable to move from one state to another
a
### Answer To set up state transitions (edges) in a multi-prompt agent, you define the conditions for moving from one state to another in the agent’s configuration. Each state contains an edges array, where you specify the destination state and the condition/description for when the transition should happen. Here’s an example from the documentation:
Copy code
json
[
  {
    "name": "information_collection",
    "state_prompt": "You will follow the steps below to collect information...",
    "edges": [
      {
        "destination_state_name": "appointment_booking",
        "description": "Transition to book an appointment."
      }
    ],
    "tools": [
      {
        "type": "transfer_call",
        "name": "transfer_to_support",
        "description": "Transfer to the support team.",
        "transfer_destination": {
          "type": "predefined",
          "number": "16175551212",
          "ignore_e164_validation": false
        },
        "transfer_option": {
          "type": "cold_transfer",
          "show_transferee_as_caller": false
        }
      }
    ]
  },
  {
    "name": "appointment_booking",
    "state_prompt": "You will follow the steps below to book an appointment...",
    "tools": [
      {
        "type": "book_appointment_cal",
        "name": "book_appointment",
        "description": "Book an annual check up.",
        "cal_api_key": "cal_live_xxxxxxxxxxxx",
        "event_type_id": 60444,
        "timezone": "America/Los_Angeles"
      }
    ]
  }
]
[(1) ]() , [(2) ]() , [(3) ]() The key is to clearly describe in the edge when and why the agent should transition. If the agent isn’t moving between states, make sure: - The edge is defined in your state’s edges array. - The state_prompt and edge description are clear and actionable. - The agent’s logic (in your prompt) matches the edge conditions. It’s also helpful to explicitly tell the agent in your prompt when to transition (e.g., “If user confirms, transition to appointment_booking.”) . Community feedback suggests that making the transition conditions and instructions as explicit as possible can improve reliability [(4) ]() , [(5) ]() .
​ To learn more, see the sources I considered: [[1] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[2] List Retell LLMs](https://docs.retellai.com/api-references/list-retell-llms) [[3] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) [[4] Multi prompt agent not always transitioning to the next state](https://discord.com/channels/1186424376300679209/1303504848196472893) [[5] Not transitioning between states](https://discord.com/channels/1186424376300679209/1291114413662801960) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy I have one appointment booking and a basic screening requirement but these are optional like based on user selection of certain variable each flow trigger, any one or both etc...what type of agent should I use and how do I make the script and flow dynamic and adjustable
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Retell AI’s Advanced Conversation Flow | Retell AI](https://www.retellai.com/blog/unlocking-complex-interactions-with-retell-ais-conversation-flow) [[2] Logic Split Node](https://docs.retellai.com/build/conversation-flow/logic-split-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer For your use case—where appointment booking and basic screening are both optional and should trigger based on user selection or variables—the recommended approach is to use a Conversation Flow Agent (also referred to as "conversational flow" in the documentation) . This agent type is designed for dynamic, multi-step logic with branching paths, making it well-suited for scenarios where different flows can be activated based on user choices or variables [(1) ]() . To make your script and flow dynamic and adjustable: - Use nodes to represent each key step (e.g., screening, appointment booking) . - Apply Logic Split Nodes to branch the flow based on conditions or user-provided variables. This allows you to direct the conversation to the appropriate node(s) depending on what the user selects or provides [(2) ]() . - You can configure transitions so that the flow triggers either or both requirements, or skips them, depending on the user's input or variable states [(2) ]() [(1) ]() . This structure enables you to build flexible, dynamic flows where each requirement is optional and controlled by real-time logic.
m
@AI Evy Logic split node not working
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Logic split node stuck](https://discord.com/channels/1186424376300679209/1435621223294959616) [[2] Discord message from @q40478 on 2025-10-30](https://discord.com/channels/1186424376300679209/1186462578310910112/1433471315293110413) [[3] Logic Split Node Equation Not Working As Expected](https://discord.com/channels/1186424376300679209/1406310248691667125) [[4] Help with Logic Split Nodes (and an example of a custom variable being used would be lovely!)](https://discord.com/channels/1186424376300679209/1358825261986087126) [[5] Logic Split Node](https://docs.retellai.com/build/conversation-flow/logic-split-node) [[6] Debug your agent response](https://docs.retellai.com/test/llm-playground-debug) ​
els/1186424376300679209/1186462578310910112/1433471315293110413) . Configuration Steps When configuring your Logic Split Node [(5) ]() : - Add conditions just like you would in other nodes - Set up the else destination: there will always be an else condition, which will be the default destination if none of the conditions are met - Ensure transition happens immediately when the agent enters this node Debugging Recommendations If your Logic Split Node is still not working [(6) ]() : 1. Add fine-tuning transition examples 2. Split the node into multiple nodes 3. Use "Regenerate Transition" to test the response Important Note Equation-based transitions for Logic Split Nodes (which would allow direct evaluation of dynamic variables without prior conversation mention) are currently under development [(2) ]() [(4) ]() .
### Answer Based on the available sources, Logic Split Nodes can fail to work correctly for several common reasons [(1) ]() [(2) ]() [(3) ]() [(4) ]() : Variable Initialization Issue Logic Split Nodes may not have access to dynamic variables immediately when the call starts [(3) ]() . When Retell starts a call, your
retell_llm_dynamic_variables
may not yet be "hydrated" (fully loaded into memory for the flow engine) . If a Split node tries to read a variable too early, it sees null/empty and takes the wrong path . Solution: Add a Hydration Guard Implement a condition to check if the variable exists or is not empty before evaluating it . You can allow 1-2 retries using a counter so it loops back until the variable loads . Variable Must Be Mentioned in Conversation First Logic Split Nodes currently require dynamic variables to be mentioned in the conversation before they can be evaluated [(2) ]() [(4) ]() . The agent must actually speak the variable out loud for the Logic Split Node to recognize it . Workaround: Add a Conversation Node Before Logic Split Add a Conversation Node before the Logic Split Node that mentions the dynamic variable value . You can use the "Skip Response" setting in the preceding Conversation Node, but note that the agent will still need to state the variable for it to be recognized [(2) ](
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy how do i redirect from global node to a specific node based on from where the global node is reached from
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer --- ### Answer Retell AI does not automatically return from Global Nodes to the original conversation flow position [(1) ]() . However, you can build this functionality manually by storing the last node in a variable and routing back with a Logic Split Node [(2) ]() . Workaround Approach: 1. Before transitioning to the Global Node, store the current node name in a dynamic variable (e.g.,
previous_node
) 2. In your Global Node, after handling the interaction, transition to a Logic Split Node 3. Configure the Logic Split Node with conditions that check the
previous_node
variable and route to the appropriate destination node based on its value Important Limitations: - You cannot directly transfer back from a Global Node to the exact previous node automatically [(1) ]() - Once you transition to a Global Node, you need to manually handle the return logic [(1) ]() [(2) ]() - This is currently an architectural limitation of Retell AI [(1) ]() This approach allows you to resume the original flow, but requires explicit configuration of all possible return paths in your Logic Split Node conditions. --- **
​ To learn more, see the sources I considered: [[1] Is it possible to return from the Global Node](https://discord.com/channels/1186424376300679209/1399484507530334368) [[2] fallback to the previous node from Global node](https://discord.com/channels/1186424376300679209/1388025209533235261) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
how do i store the previous node in dynamic variable
@AI Evy how do i store the previous node in dynamic variable
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer --- ### Answer Retell AI provides built-in system variables to track the current and previous nodes in Conversation Flow [(1) ]() . You can use
{{previous_agent_state}}
to reference the last node the agent was in . Using Built-in System Variables: The system automatically maintains these dynamic variables : -
{{current_agent_state}}
- the node the agent is currently in -
{{previous_agent_state}}
- the node the agent was previously in Implementation Example: To route back from a Global Node based on where you came from, you can use a Logic Split Node with conditions like :
Copy code
{{previous_agent_state}} == "Qualification" AND User wants to revisit last question
Important Limitation: When using a Global Node with "skip response" enabled, be aware that when you transition to a Logic Split Node afterward, the value of
{{previous_agent_state}}
will show as "ask_agent" (the Global Node name) , not the original node you want to return to . This means you may lose track of the actual previous node in this scenario . Workaround: If you need to preserve the original node before entering a Global Node, you would need to explicitly set a custom dynamic variable before transitioning to the Global Node, though the sources don't provide a specific example of how to programmatically set this value during runtime. ---
​ To learn more, see the sources I considered: [[1] Store the last node in a variable](https://discord.com/channels/1186424376300679209/1396840637189591201) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy I havent enabled skip response but wouldnt it give previous node?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer You're correct to question this. Based on the available sources, when you transition to a Global Node, the
{{previous_agent_state}}
variable should track the node you were in before entering the Global Node [(1) ]() . The limitation mentioned in the previous response specifically applies when "skip response" is enabled on the Global Node . Since you haven't enabled "skip response," the
{{previous_agent_state}}
should correctly reflect the node you came from before entering the Global Node . You can use this variable directly in a Logic Split Node after your Global Node to route back to the appropriate destination based on where the Global Node was reached from . For example, you could set up conditions in your Logic Split Node that check the value of
{{previous_agent_state}}
and route accordingly .
​ To learn more, see the sources I considered: [[1] Help with Logic Split Nodes (and an example of a custom variable being used would be lovely!)](https://discord.com/channels/1186424376300679209/1358825261986087126) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy doesnt work i should input the logic as {{previous_agent_state}}= Node name right?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer Answer Based on the community discussion, the condition format you're using should work, but there are important considerations [(1) ]() [(2) ]() : Condition Format: The format
{{previous_agent_state}} == "Node_Name"
is the correct syntax for checking the previous node [(1) ]() . However, there's a critical limitation: Logic Split Nodes currently require dynamic variables to be mentioned in the conversation before they can be evaluated [(2) ]() . This means the agent must actually speak or reference the variable value for the Logic Split Node to recognize it properly . Troubleshooting Steps: 1. Verify the exact node name - Make sure the node name in your condition exactly matches the actual node name (case-sensitive, including spaces/underscores) 2. Add a Conversation Node before the Logic Split Node - Have the agent mention or reference the
{{previous_agent_state}}
value before evaluating it in the Logic Split 3. Check if the variable is being populated - Review your call history to confirm the
{{previous_agent_state}}
variable actually contains the expected value 4. Set up the else destination - Always configure an else condition as the default destination if none of the conditions are met, since Logic Split Nodes are designed to be split points and you don't want the conversation to get stuck [(3) ]() Note: Equation-based transitions for Logic Split Nodes (which would allow more reliable evaluation of dynamic variables) are currently under development [(2) ](
/channels/1186424376300679209/1358825261986087126) .
​ To learn more, see the sources I considered: [[1] Store the last node in a variable](https://discord.com/channels/1186424376300679209/1396840637189591201) [[2] Help with Logic Split Nodes (and an example of a custom variable being used would be lovely!)](https://discord.com/channels/1186424376300679209/1358825261986087126) [[3] Logic Split Node](https://docs.retellai.com/build/conversation-flow/logic-split-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy does retell support toon?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer --- ### Answer I don't have information about "toon" support in Retell AI based on the available sources. Could you clarify what you mean by "toon"? Are you referring to: - A specific integration or service? - A telephony provider? - A text-to-speech voice style? - Something else? Once I understand what you're looking for, I can provide more specific guidance. If you'd like, I can try to provide a general answer based on my knowledge, but it would be helpful to know more context about what "toon" refers to in your use case. --- Feel free to tag me with additional details, and I'll do my best to help!
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.