Every normal edge has a transition_condition. Tried has three kinds. In the edge editor under Transitions they are the Prompt, Equation and Both options.
| UI | type |
Decided by | Cost |
|---|---|---|---|
| Prompt | prompt |
The LLM, from a sentence you write | Part of an LLM call |
| Equation | equation |
Exact rules on dynamic variables | No LLM call |
| Both | equation_prompt |
Equations must hold, then the LLM judges the sentence | LLM call only when the equations hold |
Prompt conditions#
{ "type": "prompt", "prompt": "The caller wants to book an appointment" }Each prompt edge becomes a function the LLM can call, named transition_to_<destination_node_id> (non-alphanumeric characters replaced by _, cut to 64 characters) and described as "Transition when: ". {{variables}} in the condition are rendered.
In a conversation node without an else edge, these functions ride along with the normal reply call: the LLM either answers the caller or calls a transition. In other nodes, a separate LLM call is made with the global prompt, the conversation and the conditions, and the model either calls one transition or answers "none".
Write prompt conditions as a fact about the conversation, from the caller's side:
| Weak | Better |
|---|---|
| Booking | The caller wants to book, move or cancel an appointment |
| Done | The caller has confirmed their name, date and time |
| Not interested | The caller says they do not want to continue, or asks not to be called again |
If two prompt edges point to the same node, only the first is offered.
Equation conditions#
{
"type": "equation",
"equations": [
{ "left": "{{plan}}", "operator": "==", "right": "premium" },
{ "left": "{{age}}", "operator": ">=", "right": "18" }
],
"operator": "&&"
}| Field | Type | Default | Description |
|---|---|---|---|
equations |
array, at least 1 | Each is {left, operator, right} |
|
equations[].left |
string | A {{variable}} template, or a bare variable name |
|
equations[].operator |
see below | ||
equations[].right |
string | "" |
A value, or a {{variable}} template |
operator |
"&&" or "||" |
"&&" |
Shown as AND / OR when there are two or more equations |
In the editor, click Condition to add an equation and the cross to remove one. The right-hand field is hidden for exists and not_exist.
Operators#
| Operator | True when |
|---|---|
== |
Equal. Numbers compare numerically; text compares case-insensitively |
!= |
Not equal |
>, >=, <, <= |
Numeric comparison when both sides are numbers; text comparison otherwise |
contains |
The left text contains the right text (case-insensitive) |
not_contains |
The left text does not contain the right text |
exists |
The variable is set and not empty |
not_exist |
The variable is missing or empty |
How values are compared#
- Values are strings. A side counts as a number when it parses as one after commas are removed, so
1,200equals1200. - Leading and trailing spaces are ignored for
==,!=and ordering. - A
{{template}}that does not resolve, or resolves to an empty string, counts as missing. - A bare name on the left that is not a known variable counts as missing.
- When the left side is missing, every comparison is false except
!=andnot_contains, which are true.
Which variables you can use#
Anything in the call's dynamic variables: agent defaults, request variables (retell_llm_dynamic_variables), contact fields, values saved by extract nodes, response variables from functions, code and MCP nodes, sms_status from SMS nodes, live overrides from update-live-call, and system variables such as current_hour, direction or user_number. See Dynamic variables.
Both (equation and prompt)#
{
"type": "equation_prompt",
"equations": [{ "left": "{{plan}}", "operator": "==", "right": "premium" }],
"operator": "&&",
"prompt": "The caller asks for a priority callback"
}The prompt condition is only offered to the LLM when the equations hold. Use it to gate an LLM-judged transition behind a hard rule, for example premium-only routes.
Logic split edges#
Edges on a logic split node are equations in the editor, plus a required Else.
Order matters#
Equations run before prompts and in list order. Put the most specific equation first. Prompt conditions are judged together, so make them mutually exclusive; if two could both apply, the LLM picks one.