bloodstone8994
12/03/2025, 2:41 AMAI Evy
12/03/2025, 2:41 AMAI Evy
12/03/2025, 2:42 AMtag dynamic variable changes from "lost" to "manage" after the Extract Variables node is likely related to how the Extract Variables node operates in conversation flow.
Based on the available sources, dynamic variables in Retell AI can be set at multiple levels [(1) ]() :
- Through the API call (retell_llm_dynamic_variables)
- As agent-level defaults
- Extracted during the conversation
The Extract Variables node is designed to extract new information from the conversation and create or update dynamic variables based on what the agent hears or processes . When you place an Extract Variables node after your conversation node, it's attempting to extract the tag variable from the conversation context rather than simply reading the original value you passed in.
Here's what's likely happening:
1. You pass tag: "lost" in your initial dynamic variables
2. The conversation node runs with the opening script
3. The Extract Variables node then tries to extract a tag variable, and based on the conversation context or its configuration, it's inferring or extracting "manage" instead
Recommended solutions:
1. Don't extract the tag variable - If you're already passing the tag from GHL, you don't need to extract it again. Remove tag from your Extract Variables node configuration and only extract variables that aren't already provided.
2. Use the original tag directly - Reference the tag using {{tag}} in your conversation flow edges/conditions without re-extracting it .
3. Check your Extract Variables node configuration - Ensure the extraction prompt or configuration isn't instructing the agent to determine or infer the tag value from the conversation.
Dynamic variables maintain their values throughout the conversation unless explicitly overwritAI Evy
12/03/2025, 2:42 AMtag value.
**AI Evy
12/03/2025, 2:42 AMAI Evy
12/03/2025, 2:42 AMAI Evy
12/03/2025, 2:55 AMbloodstone8994
12/03/2025, 2:55 AMAI Evy
12/03/2025, 2:55 AMjavascript
"edges": [
{
"id": "edge_available_lost",
"transition_condition": {
"type": "prompt",
"prompt": "Customer is available AND tag is lost"
},
"destination_node_id": "lost_flow_node"
},
{
"id": "edge_available_manage",
"transition_condition": {
"type": "prompt",
"prompt": "Customer is available AND tag is manage"
},
"destination_node_id": "manage_flow_node"
},
{
"id": "edge_not_available",
"transition_condition": {
"type": "prompt",
"prompt": "Customer is not available"
},
"destination_node_id": "goodbye_node"
}
]
This approach keeps your original tag value from GHL intact and routes the conversation based on both availability and the tag without re-extracting it.AI Evy
12/03/2025, 2:55 AMAI Evy
12/03/2025, 2:55 AM{{opening_script}} dynamic variable [(1) ]()
- This node should handle the availability question
*Node 2a: Conditional Edge - If Available (Yes) *
- Create an edge with a transition condition checking if the person is available [(1) ]() [(2) ]()
- The destination should branch based on the {{tag}} value
*Node 2b: Conditional Edge - If Not Available (No) *
- Create an edge with a transition condition checking if the person is NOT available
- Destination: Goodbye node
Key Point - Use Edges with Conditions, Not Extract Variables:
Since you're already passing the tag from GHL as a dynamic variable, reference it directly in your edge conditions using {{tag}} [(1) ]() . You don't need an Extract Variables node.
Example Edge Structure:AI Evy
12/03/2025, 2:56 AMAI Evy
12/03/2025, 3:06 AMbloodstone8994
12/03/2025, 3:06 AMAI Evy
12/03/2025, 3:06 AMAI Evy
12/03/2025, 3:06 AMAI Evy
12/03/2025, 3:06 AMbloodstone8994
12/03/2025, 3:07 AMbloodstone8994
12/03/2025, 3:08 AMAI Evy
12/03/2025, 3:08 AMAI Evy
12/03/2025, 3:08 AMinbound_webhook_url field to your webhook endpoint [(1) ]() [(3) ]()
2. When an inbound SMS is received, Retell will POST a payload to your endpoint with this structure [(1) ]() :
json
{
"event": "chat_inbound",
"chat_inbound": {
"agent_id": "agent_12345",
"agent_version": 1,
"from_number": "+12137771234",
"to_number": "+12137771235"
}
}
The webhook has a 10-second timeout and will retry up to 3 times if no success status (2xx) is received .
Important considerations:
Based on community discussions, there are some nuances with SMS webhooks [(4) ]() :
- The webhook may only fire at the start of a conversation
- The agent needs to transition to an end call state to properly end the conversation
- There may be edge cases where the webhook doesn't fire if a user replies after a chat has ended
You can verify your webhook is working by checking if conversation IDs are being created when SMS messages are received .AI Evy
12/03/2025, 3:08 AMAI Evy
12/03/2025, 3:08 AMbloodstone8994
12/03/2025, 5:06 AMAI Evy
12/03/2025, 5:06 AMAI Evy
12/03/2025, 5:06 AMjavascript
"edges": [
{
"id": "edge_1",
"transition_condition": {
"type": "prompt",
"prompt": "Customer wants to book appointment"
},
"destination_node_id": "book_appointment"
}
]
In your case, you would add edges to your opening script conversation node with conditions like "Customer is available AND tag is lost" to route to the appropriate next node based on both availability and the tag value [(2) ]() [(1) ]() .AI Evy
12/03/2025, 5:06 AMAI Evy
12/03/2025, 5:06 AMbloodstone8994
12/03/2025, 5:09 AMAI Evy
12/03/2025, 5:09 AMAI Evy
12/03/2025, 5:09 AMEquation: {{tag}} == "lost"
[(1) ]() , [(2) ]()
With an additional prompt condition: "User says yes, sure, agreed, or indicates they are available to talk" [(1) ]()
Edge 2 - Available AND tag is "manage":
Equation: {{tag}} == "manage"AI Evy
12/03/2025, 5:09 AM{{tag}} with the curly braces when referencing dynamic variables in equations [(3) ]()
- The == operator is for string comparison and does not require numerical input [(1) ]()
- Equation-based transitions are recommended when branching paths are determined solely by dynamic variables
- You can combine equation conditions with prompt-based conditions for more complex logic [(1) ]() [(2) ]()
Why use equations instead of prompts for the tag check:
The recent platform update introduced equation-based transitions specifically to avoid writing things like {{dynamic_variable}} === value in transition prompts [(2) ]() . Equations provide better results when checking dynamic variable values .
If you only use a prompt like "User is available AND tag is lost", the LLM has to interpret both conditions, which can be less reliable than using an equation to check the {{tag}} value directly [(1) ]() [(2) ]() .AI Evy
12/03/2025, 5:09 AMAI Evy
12/03/2025, 5:09 AMbloodstone8994
12/04/2025, 5:17 AMAI Evy
12/04/2025, 5:17 AMAI Evy
12/04/2025, 5:17 AM{{tag}}.
However, based on the available information about dynamic variables and conversation flow configuration, here are three potentially relevant sources that might help:
- [Dynamic Variables]()
- [Step 1: Configure global settings]()
- [Create Conversation Flow]()
Would you like me to provide a general answer based on my knowledge about potential workarounds?AI Evy
12/04/2025, 5:17 AMAI Evy
12/04/2025, 5:17 AMbloodstone8994
12/04/2025, 5:18 AMAI Evy
12/04/2025, 5:18 AMAI Evy
12/04/2025, 5:18 AM{{tag}} within your voicemail configuration .
Potential workaround approach:
Since dynamic variables work in voicemail prompts , you could structure your voicemail message to include conditional language that references the {{tag}} variable directly:
"Hi, this is [Your Company]. {{tag}} - [relevant message based on tag value]. Please leave a message and we'll get back to you."
However, this approach would display the raw tag value rather than conditionally selecting different complete voicemail scripts.
Alternative solution using Conversation Flow:
A more robust approach would be to handle voicemail detection within your conversation flow structure rather than at the global voicemail level. You could:
1. Create separate conversation flow paths for "lost" and "manage" tags using equation-based transitions: {{tag}} == "lost" and {{tag}} == "manage"
2. Within each path, configure voicemail handling specific to that tag value
3. Use the voicemail detection feature within the context of each conversation path
This would give you more granular control over the voicemail message based on the tag value.
Recommendation:
For the most accurate implementation guidance specific to your use case with multiple conditional voicemails, I'd recommend reaching out to Retell support:
- Visit [Contact Sales]()
- Visit [)
They can provide specific guidance on the best way to implement tag-based voicemail selection in your setup.AI Evy
12/04/2025, 5:18 AMAI Evy
12/04/2025, 5:18 AMbloodstone8994
12/04/2025, 5:25 AMAI Evy
12/04/2025, 5:25 AMAI Evy
12/04/2025, 5:26 AMinbound_webhook_url in your phone number or chat agent settings
2. When someone sends a message to your chat agent, Retell will send a POST request with this structure :
json
{
"event": "chat_inbound",
"chat_inbound": {
"agent_id": "agent_12345",
"agent_version": 1,
"from_number": "+12137771234",
"to_number": "+12137771235"
}
}
Important webhook details:
- The webhook has a 10-second timeout
- It will retry up to 3 times if no success status (2xx) is received
- If all retry attempts fail and the number has an inbound agent ID set, it will connect to that agent; otherwise, it will disconnect
This webhook notification system works for both SMS and chat interactions with your Retell AI agents [(1) ]() [(2) ]() .AI Evy
12/04/2025, 5:26 AMAI Evy
12/04/2025, 5:26 AMbloodstone8994
12/04/2025, 5:27 AMbloodstone8994
12/04/2025, 5:27 AMAI Evy
12/04/2025, 5:27 AMAI Evy
12/04/2025, 5:28 AMchat.ended and chat.analyzed) but not the inbound webhook event (chat_inbound) [(1) ]() .
These are actually two different webhook types with different purposes:
1. Inbound Webhook - Fires when someone initiates a chat
- Event type: chat_inbound
- Purpose: Notifies you when an inbound message is received, before the chat session is fully established
- Configured via: inbound_webhook_url in your phone number settings
2. Agent-Level Webhook - Fires during and after the chat session [(2) ]() [(3) ]() [(4) ]()
- Event types: chat.ended, chat.analyzed, etc.
- Purpose: Provides chat lifecycle events and analysis
- Configured via: webhook_url in your chat agent settings
To receive notifications when someone sends a message:
You need to configure the inbound webhook (inbound_webhook_url) at the phone number level, not just the agent-level webhook [(1) ]() . The inbound webhook will send you a POST request with this payload structure when a message is received :
json
{
"event": "chat_inbound",
"chat_inbound": {
"agent_id": "agent_12345",
"agent_version": 1,
"from_number": "+12137771234",
"to_number": "+12137771235"
}
}AI Evy
12/04/2025, 5:28 AMchat_inbound events after configuring the inbound webhook URL, I'd recommend reaching out to support with your specific configuration details.AI Evy
12/04/2025, 5:28 AMAI Evy
12/04/2025, 5:28 AMAI Evy
12/04/2025, 5:52 AMbloodstone8994
12/04/2025, 5:52 AMAI Evy
12/04/2025, 5:52 AMchat_inbound webhook payload does not include the initial SMS message content by default [(1) ]() .
The inbound webhook for SMS/chat only provides these fields in the payload :
- agent_id
- agent_version
- from_number
- to_number
The documentation states: "Note that the call / SMS is not connected, and a call / SMS object is not yet created (and if you decided not to take the call for example, the call object will not be created) . Therefore you will not have a call / SMS object and call / SMS id inside the payload" .
Potential workaround:
Since the inbound webhook fires before the chat session is established and doesn't include the message content , you could:
1. Respond to the chat_inbound webhook to accept the chat
2. Use dynamic variables to pass context if needed through the webhook response [(1) ]() [(2) ]()
3. Access the actual message content through the chat transcript after the session starts
The inbound webhook response allows you to set dynamic_variables and metadata fields [(1) ]() , which you could potentially use to store information about the incoming message if you process it separately.
For the most accurate guidance on accessing the initial SMS content in the webhook payload, I'd recommend contacting Retell support:
- Visit [Contact Sales]()
- Visit [)
Would you like me to provide a general answer about potential alternative approaches?AI Evy
12/04/2025, 5:54 AMAI Evy
12/04/2025, 5:54 AM