https://retellai.com/?utm_source=discord&utm_medium=seo logo
how to catch inbound webhook dynamic variable and ...
# ❓・ai-evy-support
v
@AI Evy how to catch inbound webhook dynamic variable and use it in logic split in the agent, do i use == or {{}} how?
a
Thanks for tagging me @Vyyy. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
### Answer To set dynamic variables via inbound webhook and use them in Logic Split nodes: 1. Set up your inbound webhook response Your webhook should return dynamic variables in this format [(1) ]() :
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "user_name": "John Doe",
      "user_email": "john@example.com"
    }
  }
}
2. Use the variable in Logic Split with equation syntax In Conversation Flow, you can check if a variable is set using equation-based transitions [(2) ]() :
Copy code
Equation: {{user_name}} exists
Result: True if variable is defined
To compare values in Logic Split, use the
{{variable_name}}
syntax with comparison operators . For example, if you set a
spam_flag
variable via webhook, you would reference it as
{{spam_flag}}
and compare it like
{{spam_flag}} == "yes"
. Important notes: - Dynamic variables work in prompts, begin messages, tool configurations, and conversation flow conditions - The spaces around the variable name will be trimmed when evaluating - Variables must be strings in the
retell_llm_dynamic_variables
field
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.