https://retellai.com/?utm_source=discord&utm_medium=seo logo
Logic Split Node Equation Not Working As Expected
# ❓・bug-report
m
Hi - I'm sending this variable (agent_vm_caller_name) under "retell_llm_dynamic_variables" in my /v2/create-phone call API call. Other variables are passing to the conversation flow, but this logic node isn't working. Since I'm passing the variable "Wendy" via the API, this module's logic should NOT return "Wrong Agent". But every time it's following the wrong route here, despite my equation setup, as you can see. https://cdn.discordapp.com/attachments/1406310248691667125/1406310249643900968/image.png?ex=68a1fffb&is=68a0ae7b&hm=8d491aac0e474a953979d2b75d715d5c5c3a1f3a01a9f2bf0f1d933bb5cc1534& https://cdn.discordapp.com/attachments/1406310248691667125/1406310250461528196/image.png?ex=68a1fffb&is=68a0ae7b&hm=b4377903fef7ee93e0dd93450c390fe6fde70099c3ffb68a7593ebb5a2b896a9&
Detailed call logs: 2025-08-16 16:09:55.282 call_c18427d48761e256cdce5941e6a info: Starting call: call_c18427d48761e256cdce5941e6a 2025-08-16 16:10:02.041 call_c18427d48761e256cdce5941e6a info: Webhook triggered for call_started 2025-08-16 16:10:02.173 call_c18427d48761e256cdce5941e6a info: Webhook response received for call_started 2025-08-16 16:10:05.514 call_c18427d48761e256cdce5941e6a info: Transitioning from node begin (name: begin) to node node-1755359729267 (name: Identify VM Caller) 2025-08-16 16:10:05.521 call_c18427d48761e256cdce5941e6a info: Transitioning from node node-1755359729267 (name: Identify VM Caller) to node node-1755360237602 (name: Conversation) 2025-08-16 16:10:06.776 call_c18427d48761e256cdce5941e6a info: Transitioning from node node-1755360237602 (name: Conversation) to node node-1755360043278 (name: End Call) 2025-08-16 16:10:06.777 call_c18427d48761e256cdce5941e6a info: Calling tool: end_call Arguments: {} 2025-08-16 16:10:06.777 call_c18427d48761e256cdce5941e6a info: Ending call: call_c18427d48761e256cdce5941e6a 2025-08-16 16:10:07.194 call_c18427d48761e256cdce5941e6a info: Webhook triggered for call_ended 2025-08-16 16:10:07.340 call_c18427d48761e256cdce5941e6a info: Webhook response received for call_ended 2025-08-16 16:10:08.637 call_c18427d48761e256cdce5941e6a info: Webhook triggered for call_analyzed 2025-08-16 16:10:08.774 call_c18427d48761e256cdce5941e6a info: Webhook response received for call_analyzed https://cdn.discordapp.com/attachments/1406310248691667125/1406310520642080808/image.png?ex=68a2003c&is=68a0aebc&hm=724070374c1716388b22eb3a08aeca7f8dc7e5136e86b40bb6e01ecd42397447&
s
Your logic split fails because the variable isn’t matching exactly. Make sure you send it as a string in your API payload:
Copy code
json
"retell_llm_dynamic_variables": {
  "agent_vm_caller_name": "Wendy"
}
Then confirm the condition in the flow is spelled exactly the same (
agent_vm_caller_name = "Wendy"
). Quick test: add a temp node that says `Hello {{agent_vm_caller_name}}`—if it prints “Wendy,” your variable is fine, and the condition will work.
m
that's what i wondered initially, but i've checked and the actual payload is correct. i did your test to do hello {{agent_vm_caller_name}} and it passed it correctly. the issue is with the logic flow. is this the correct syntax? https://cdn.discordapp.com/attachments/1406310248691667125/1406338996451283114/image.png?ex=68a21ac1&is=68a0c941&hm=1e440650fbd4a7c877f1deb1a30480837743df394b260e5c10caa28d3764a526&
s
In Retell’s flow builder the comparison is string match only, no quotes needed in the condition editor. The correct syntax is just: agent_vm_caller_name = Wendy
m
It auto populates the quotes. All I entered was the top image (configure conditions), where you can see i put no quotes
s
change condition to contains Wendy — if it works, then it’s whitespace/case. If not, then move the split one step later in the flow.
m
I had tried contains as well using ANY of the conditions, and it didn't work. Why would I need to move the split later in the flow? I need it at the start.
setting this up with a prompt instead of the conditional logic worked, which leads me to believe there's a bug in the tool https://cdn.discordapp.com/attachments/1406310248691667125/1406356743696552008/image.png?ex=68a22b48&is=68a0d9c8&hm=f8dfe287d03d761153fa2226c753d53247a3e5553434a2fb3d8a599b4d43e9d2&
s
HI @mushrooooom you could Use PromptBased Logic which would be like "Continue using the prompt-based approach since it works reliably: - Add instruction in agent prompt to check agent_vm_caller_name - Use LLM decision-making instead of conditional nodes"
Add a brief conversation node before the conditional logic This allows variables to fully initialize
m
yea, the prompbased logic works fine, but it led me to believe that the conditional checks weren't working. you're saying that perhaps the reason is that it doesn't initialize as fast as the conversation nodes?
@shahretell - are you indeed saying the logic flow is too slow to initialize as the first module in the flow?
s
the first Split can run before variables are ready. Add a hydration guard (exists → then compare) or a tiny init hop and it will behave consistently.
m
sorry, can you elaborate on what a "hydration guard" and "init hop" are?
@shehroze_retell ?
s
When Retell starts a call, your retell_llm_dynamic_variables (like agent_vm_caller_name) may not yet be “hydrated” (i.e. fully loaded into memory for the flow engine). If a Split node tries to read it too early, it sees null/empty and takes the wrong path. A hydration guard is a condition like: agent_vm_caller_name exists or agent_vm_caller_name != "" This makes sure “the variable is loaded with something” before you compare it to "Wendy".
m
i see. so if i implement this hydration guard and the variable is NOT yet loaded (ie, agent_vm_caller_name = ""), then is there a way to keep looping this until it's able to choose the correct path? in other words, if i identify it's not loaded yet, how do i still apply the logic that i want?
s
You can allow 1–2 retries (using a counter) so it loops back until the variable loads. If after a couple tries it’s still empty, fall back gracefully by asking the caller.