https://retellai.com/?utm_source=discord&utm_medium=seo logo
We use Retell AI with GoHighLevel
# ❓・ai-evy-support
b
@AI Evy We use Retell AI with GoHighLevel. That way we can use Retell for our AI Voice Agent, and GoHighLevel for our messaging system. Whenever someone picks up our call we want to tell GoHighLevel to move that person to our "Reached by call" workflow. We do that by assigning a "Reached by call" tag to people who reach a certain point in the call to prove that they actually accepted the call, and that it didn't just go to voicemail. Specificially our first node is a conversation node that asks them if its okay for us to continue the call. If they reply yes or agree that then transitions to a function node that we call "Ghl-update-client" The "Ghl-update-client" function node is a custom POST API call node that sends the ghl_contact_id and the "reached by call" tag to our GoHighLevel integration endpoint at: POST https://secure.lasikgrowth.com/integrations/ghl/contact/update Inside the function node setup: - Under Parameters (Form): - id is set to {{ghl_contact_id}} (type: string) - tags is set to reached by call (type: string or array) - Payload: args only is enabled - The request includes a header: - x-api-key: [our key] We expect {{ghl_contact_id}} to resolve to the actual GoHighLevel contact ID (a UUID-style string like 01H8ZJ9K2...) and be automatically injected by Retell. We had issues with two leads today, let me know when you are ready for me to go into detail about the two lead's exact issues, so I can ask my questions
a
Thanks for tagging me @byredyre. I'll look through relevant sources and get back to you shortly.
### Answer I'm ready to help troubleshoot your Retell AI and GoHighLevel integration. Your setup looks well-structured—using a conversation node to confirm call acceptance, then triggering a custom function node to update GoHighLevel with the contact tag. Based on your configuration, when the custom function node executes, Retell should send a POST request to your endpoint with the dynamic variable
{{ghl_contact_id}}
resolved to the actual contact ID [(1) ]() . The custom function setup you described—using Parameters (Form) with
id
set to
{{ghl_contact_id}}
and
tags
set to "reached by call," along with "Payload: args only" enabled—aligns with how custom functions work in Retell AI . I'm ready to hear the specific issues you encountered with the two leads. Please share the details about what went wrong—for example, whether the function node failed to execute, the contact ID wasn't resolved correctly, or the GoHighLevel endpoint didn't receive the expected data. This will help identify whether the issue is with dynamic variable resolution, the function node configuration, or the API call itself.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
@AI Evy We had issues with two leads today: Lead 1: Their GHL ID was correct, but the tag that was supposed to be sent through as "Reached by call" was sent through as "called". It seems like Retell AI just suddenly decided to change this for just this person. Nothing changed in the function node, and it looks exactly the same with "Reached by call" clearly being the tag that's supposed to be sent through. Lead 2: For this person, the value that was passed into the "id" field was not the GHL contact ID at all. Instead, Retell used the person’s first name ("Meleke") as the ghl_contact_id. This caused our endpoint to fail, because "Meleke" is not a valid GHL ID. In earlier calls (even just 30 minutes before this one), Retell correctly passed the proper GHL contact ID as a UUID-style string. For this specific call, the variable {{ghl_contact_id}} seems to have resolved incorrectly to the caller’s first name instead of the actual ID. Nothing in our function node or configuration changed between these calls. We are trying to understand: - How Retell resolves the {{ghl_contact_id}} variable. - Whether Retell is pulling this value from metadata, session memory, or falling back to other fields like first_name. - Why Retell would suddenly replace the correct ID with a name in one call, and change a static tag in another call. - Whether there is a way to lock or validate variable types so these kinds of substitutions cannot happen. - How we can ensure stable, predictable behavior before deploying this system to more clinics. Any guidance or recommendations would be greatly appreciated.
a
Thanks for the follow-up, @byredyre. I'll get back to you soon.
### Answer I understand your frustration with the inconsistent dynamic variable resolution. Based on the available documentation, I can address some of your questions, though the sources don't provide complete answers to all aspects of your issue. ## How Dynamic Variables Work in Custom Functions Custom functions in Retell AI support dynamic variables in request headers, query parameters, and parameter values [(1) ]() [(2) ]() . When you set a parameter like
id
to
{{ghl_contact_id}}
, Retell should resolve this variable at runtime from the call's dynamic variables . ## Variable Resolution Source Dynamic variables can be set in several ways: - Through the API when initiating calls (using
retell_llm_dynamic_variables
) [(3) ]() - Extracted during the conversation using Extract Dynamic Variable nodes - Passed via webhooks using the
dynamic_variables
field in responses From a community discussion, there's evidence that dynamic variables may not persist correctly between turns in some cases [(4) ]() . One user reported that updated state objects weren't being passed back correctly on subsequent webhook calls . ## Addressing Your Specific Issues Lead 1 (Tag Changed from "Reached by call" to "called") : The documentation doesn't explain why a static string value would change. Since you have
tags
set to a static value "reached by call" in your Parameters (Form) , this shouldn't be subject to variable resolution at all [(1) ]() [(2) ]() . This appears to be an
unexpected behavior. Lead 2 (ID Replaced with First Name) : This suggests the
{{ghl_contact_id}}
variable either: - Wasn't set correctly for that call - Was overwritten by another value during the conversation - Fell back to a different variable (possibly
first_name
) The documentation doesn't describe a fallback mechanism where Retell would substitute one variable for another if the requested variable is missing . ## Recommendations 1. **Verify Variable Setting**: Ensure
ghl_contact_id
is being set correctly at call initiation or extracted early in the conversation flow before the function node executes. 2. **Check Call Logs**: Review the specific call logs for both leads in your Retell dashboard to see what dynamic variables were actually present when the function node executed. 3. **Add Validation**: Consider adding a conversation node before your function node that confirms the presence and format of
{{ghl_contact_id}}
before proceeding. 4. **Contact Support**: Since the behavior you're describing (static values changing, variable substitution) isn't documented and represents potentially serious reliability issues, I recommend reaching out to Retell support directly with the specific call IDs for investigation. Visit [Contact Sales]() or [) for direct support. The sources don't provide information about variable type validation or locking mechanisms to prevent these kinds of substitutions .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] Dynamic Variables](https://discord.com/channels/1186424376300679209/1356680357084135558) [[4] Function Node Not Triggering External Webhook](https://discord.com/channels/1186424376300679209/1422215353857212450) ​
b
@AI Evy Unfortunately, not very helpful. I've already done 1 and 2 as part of a general diagnostic procedure.
a
Thanks for the follow-up, @byredyre. I'll get back to you soon.
### Answer I understand your frustration. Based on the sources, there are some known issues with dynamic variable resolution in Retell AI that may explain what you're experiencing. ## Known Issues with Dynamic Variables in Function Nodes From community reports, there are documented problems with how dynamic variables work in custom function nodes [(1) ]() [(2) ]() : 1. Dynamic variables in function query parameters are not being parsed correctly [(1) ]() . Users have reported that variables need to be accessed with specific syntax (like
data.locations[0].id
rather than just
locations[0].id
) for them to resolve properly in function nodes . 2. Logic Split Nodes and function nodes may not access dynamic variables reliably [(2) ]() . The issue occurs because dynamic variables may not be "hydrated" (fully loaded into memory) when the node tries to access them . ## What This Means for Your Setup Your issues with: - Lead 1 (tag changing from "Reached by call" to "called") - Lead 2 (
{{ghl_contact_id}}
resolving to "Meleke" instead of the UUID) ...suggest that Retell may be experiencing variable resolution failures or incorrect fallback behavior that isn't documented in the official sources. ## Additional Diagnostic Steps Since you've already verified the call logs and variable settings, here are more specific checks: 1. Check the exact request body being sent to your endpoint - you can verify this by logging what your GoHighLevel integration endpoint actually receives. This will show whether Retell is sending the wrong value or if
something else is transforming it. 2. Verify the
retell_llm_dynamic_variables
payload
when initiating outbound calls [(3) ]() . For outbound calls, you set dynamic variables in the Create Phone Call API using the
retell_llm_dynamic_variables
field, where all values must be strings :
Copy code
json
{
  "ghl_contact_id": "01H8ZJ9K2...",
  "first_name": "Meleke"
}
3. Test with the Update Call API - you can override dynamic variables mid-call using the Update Call API [(4) ]() . This might help you verify if the issue is with initial variable setting or runtime resolution. ## Unfortunately... The sources don't document: - Why static string values would change - Any fallback mechanism where one variable substitutes for another - Variable type validation or locking features Given that you're experiencing undocumented behavior that affects production reliability, you'll need direct engineering support from Retell to investigate the specific call IDs and determine why variable resolution is failing. Visit [Contact Sales]() or [) Would you like a general answer based on my knowledge of how similar systems typically handle variable resolution issues?
​ To learn more, see the sources I considered: [[1] dynamic variables in function query parameters are not parsed](https://discord.com/channels/1186424376300679209/1414306451656151291) [[2] Discord message from @q40478 on 2025-10-30](https://discord.com/channels/1186424376300679209/1186462578310910112/1433471315293110413) [[3] Outbound Calls (Make Calls)](https://docs.retellai.com/deploy/outbound-call) [[4] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.