https://retellai.com/?utm_source=discord&utm_medium=seo logo
, I am using the conversation flow voice agent
# ❓・ai-evy-support
b
@AI Evy , I am using the conversation flow voice agent. I am sending a json from ghl with the opening script and a tag of either lost or manage. The purpose of the tag is for the agent to know which conversation flow it will go. So after the begin node, I placed a conversation node for it to read the opening script and check is the person is available to talk or not. after that the next node is extract dynamic variable,my purpose is for it to read the tag from the ghl, but tha thing is, it changed the tag,why is that? I have here a sample detail: Dynamic Variables contact_id: IXlT73FE0innfgQ7OT6N email: tech@aisalesengine.com.au first_name: Dan full_name: Dan Jacob opening_script: Hi Dan, this is AI Will calling on behalf of Will fromTorres Property. Will asked me to reach out. Is now a good time for a quick chat? phone: +63 915 596 0923 stage: Day 0 tag: lost Extracted Dynamic Variables current_node: Conversation previous_node: Extract Variables tag: manage
a
Thanks for tagging me @bloodstone8994. I'll look through relevant sources and get back to you shortly.
### Answer The issue you're experiencing where the
tag
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 overwrit
ten . The Extract Variables node is overwriting your original
tag
value. **
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @bloodstone8994. I'll get back to you soon.
b
@AI Evy So how should I set up the conversation flow? begin node - opening script asking if they are availbale to talk, if Yes read tag as lost or manage, if no say good bye.
a
Copy code
javascript
"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.
​ To learn more, see the sources I considered: [[1] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) [[2] Retell AI’s Advanced Conversation Flow | Retell AI](https://www.retellai.com/blog/unlocking-complex-interactions-with-retell-ais-conversation-flow) ​
### Answer Based on the available sources, here's how you should structure your conversation flow: Recommended Flow Structure: 1. Begin Node → 2. *Conversation Node (Opening Script & Availability Check) * → 3. Conditional Edges Based on Response Detailed Setup: Node 1: Conversation Node - Opening Script - Set the instruction to ask if they're available using your
{{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:
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @bloodstone8994. I'll get back to you soon.
b
Thank you. Is there a way for us to get notified if someone sent an sms? @AI Evy
a
### Answer Yes, for inbound SMS notifications, you can use the Inbound Webhook feature [(1) ]() . When you set up two-way SMS conversation with a chat agent attached to your number, the inbound webhook can be used to filter and add context to inbound SMS . The inbound webhook will send notifications when SMS messages are received, allowing you to process and respond to incoming texts programmatically . Important notes: - SMS capabilities are currently limited to US numbers only [(1) ]() [(2) ]() - You need to enable SMS capabilities first through either Retell Twilio numbers or by bringing your own Twilio number [(1) ]() - For Retell Twilio numbers, the SMS enablement process requires business profile approval, brand approval, and SMS campaign approval, which can take 2-3 weeks To set up inbound SMS handling, attach a chat agent to your SMS-enabled number, and configure the inbound webhook to receive notifications when users send SMS messages to your number .
​ To learn more, see the sources I considered: [[1] Send & receive SMS](https://docs.retellai.com/deploy/enable-sms) [[2] TEXT MESSAGE ISSUE](https://discord.com/channels/1186424376300679209/1424595052595904542) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
I already have my twilio sms number in retell and connected to a chat agent @User
I already have my twilio sms number in retell and connected to a chat agent @AI Evy
a
Thanks for the follow-up, @bloodstone8994. I'll get back to you soon.
### Answer Since you already have your Twilio SMS number connected to a chat agent in Retell, you can configure an inbound webhook to receive notifications when someone sends an SMS [(1) ]() [(2) ]() . How to set up the inbound webhook: 1. In your phone number configuration in Retell, set the
inbound_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) ]() :
Copy code
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 .
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Send & receive SMS](https://docs.retellai.com/deploy/enable-sms) [[3] Create Phone Number](https://docs.retellai.com/api-references/create-phone-number) [[4] Inbound SMS webhook doesn't appear to work](https://discord.com/channels/1186424376300679209/1415008574215815268) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
@AI Evy where can I see this conditional Edge
a
Thanks for the follow-up, @bloodstone8994. I'll get back to you soon.
### Answer ### Answer In the Retell AI Dashboard, you can view and configure conditional edges in the Conversation Flow visual editor [(1) ]() . Where to find edges: 1. Navigate to your agent in the Retell AI Dashboard 2. Open the Conversation Flow editor 3. Select any node - edges appear as connections between nodes 4. Click on a node to view its edges in the node configuration panel Edge components: [(2) ]() Each edge contains: - **Edge ID**: Unique identifier - **Transition Condition**: The rule that determines when this edge is taken - **Destination Node ID**: Where the conversation flows next Viewing edge details: When you select a node, you'll see its edges listed with their transition conditions [(1) ]() . Edges define the conversation flow by connecting nodes and determining when and where to move next . Example edge structure from the API: [(2) ]()
Copy code
javascript
"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) ]() .
​ To learn more, see the sources I considered: [[1] Node Overview](https://docs.retellai.com/build/conversation-flow/node) [[2] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
@AI Evy So how should I write the transition condition? like this If user says yes, sure, or agreed or is available to talk and tag is lost? or like this If user says yes, sure, or agreed or is available to talk and {{tag}} is lost?
a
Thanks for the follow-up, @bloodstone8994. I'll get back to you soon.
### Answer ### Answer For your transition condition, you should use equation-based transitions for checking the dynamic variable value, combined with a prompt-based condition for user availability [(1) ]() [(2) ]() . Recommended approach: Create two separate edges from your opening script node: Edge 1 - Available AND tag is "lost":
Copy code
Equation: {{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":
Copy code
Equation: {{tag}} == "manage"
, [(2) ]() With the same prompt condition: "User says yes, sure, agreed, or indicates they are available to talk" [(1) ]() Important notes about the syntax: - Use
{{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) ]() .
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[2] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[3] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
@AI Evy how can I use 2 voicemails? I want it to check the tag if it's lost or manage, then read the correct voicemail.?
a
Thanks for the follow-up, @bloodstone8994. I'll get back to you soon.
### Answer ### Answer I don't have direct information in the sources about configuring multiple voicemail messages based on dynamic variables like
{{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?
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
@AI Evy Would you like me to provide a general answer based on my knowledge about potential workarounds? yes
a
Thanks for the follow-up, @bloodstone8994. I'll get back to you soon.
### Answer Based on the available sources, dynamic variables can be used in voicemail prompts and messages [(1) ]() . While there isn't explicit documentation about using conditional voicemail messages based on dynamic variables, you can reference
{{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:
Copy code
"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.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
How can I get notified if someone sends a message in retell ai chat agent? @AI Evy
a
Thanks for the follow-up, @bloodstone8994. I'll get back to you soon.
### Answer ### Answer For chat agents, you can use webhooks to get notified when messages are sent [(1) ]() . When you configure an inbound webhook for your chat agent, Retell will POST a payload to your webhook endpoint when an inbound chat message is received . Setting up chat notifications: 1. Configure the
inbound_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 :
Copy code
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) ]() .
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Send & receive SMS](https://docs.retellai.com/deploy/enable-sms) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
my webhook only receives chat ended and chat analyzed
@AI Evy my webhook only receives chat ended and chat analyzed
a
Thanks for the follow-up, @bloodstone8994. I'll get back to you soon.
### Answer Based on your description, it sounds like you're receiving the standard post-chat webhook events (
chat.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 :
Copy code
json
{
  "event": "chat_inbound",
  "chat_inbound": {
    "agent_id": "agent_12345",
    "agent_version": 1,
    "from_number": "+12137771234",
    "to_number": "+12137771235"
  }
}
The inbound webhook has a 10-second timeout and will retry up to 3 times if no success status (2xx) is received . Important note from the community: [(5) ]() There have been reports that post-chat analysis variables may not appear in the webhook JSON response for chat agents, though they do appear in the UI . This is different from voice agents where the variables are included in the webhook response . If you're still not receiving
chat_inbound
events after configuring the inbound webhook URL, I'd recommend reaching out to support with your specific configuration details.
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Update Chat Agent](https://docs.retellai.com/api-references/update-chat-agent) [[3] List Chat Agents](https://docs.retellai.com/api-references/list-chat-agents) [[4] Get Chat Agent](https://docs.retellai.com/api-references/get-chat-agent) [[5] Discord message from @santoshsingh212e_48455 on 2025-10-15](https://discord.com/channels/1186424376300679209/1186462578310910112/1427886267235963013) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @bloodstone8994. I'll get back to you soon.
b
@AI Evy How can I include the initial sms in that chat inbound json?
a
### Answer Based on the available sources, the
chat_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?
​ 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) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.