https://retellai.com/?utm_source=discord&utm_medium=seo logo
I'm having difficulty with an agent transfering a ...
# ❓・ai-evy-support
g
@AI Evy I'm having difficulty with an agent transfering a call out to a human when using a variable for the number. It won't make the transfer, but the agent DOES know the number - I have some debug in where it reads out the numbers to me. > Agent: Say “Debug: primary is +4477 [redacted] secondary is +4474 [redacted] third is +4478 [redacted].” > User: Thank you. > Tool Invocation: transfer_call_1767798303539 > Tool Result > Agent: Thank you for your patience. Please hold while I connect you to a member of the team. > Agent: Just checking in—are you still there? If you’d like to continue, I’m ready to assist. > User: Yes. > Tool Invocation: transfer_call_1767798303539 > {"execution_message": "Thank you [redacted] I'm going to place you on a brief hold while I locate a member of the team to transfer you to."} > Tool Result >
Copy code
{
  "status": "Error transferring: Transfer destination number is a dynamic variable that's not populated."
}
> Agent: Thank you for waiting. Please hold while I try to connect you to the next available team member.
a
Thanks for tagging me @Gza. I'll look through relevant sources and get back to you shortly.
### Answer The error message
"Transfer destination number is a dynamic variable that's not populated"
indicates that while your agent can read the variable values in the prompt context, the dynamic variable is not being properly resolved when the Transfer Call tool executes. [(1) ]() ## How Dynamic Variables Work for Transfer Calls The transfer number can be set to a dynamic variable that gets substituted at runtime. However, for this to work, the variable must be properly populated before the call starts or through the appropriate mechanism. ## Key Points to Check 1. **Variable Population Timing**: Dynamic variables in
retell_llm_dynamic_variables
are for passing in variables you want to use in the prompt before the call starts. [(2) ]() If you're trying to use values collected during the call as transfer numbers, this won't work the same way. 2. **For Inbound Calls**: Custom SIP headers (starting with
X-
) are automatically extracted and added to your dynamic variables collection. [(3) ]() You can access them by stripping the
X-
prefix. 3. **For Outbound Calls**: Set your variables in the
retell_llm_dynamic_variables
field when using the Create Phone Call API. [(4) ]() ## Likely Cause The agent can read the numbers because they exist in the prompt context, but the Transfer Call tool requires the dynamic variable to be formally registered in the
retell_llm_dynamic_variables
collection at call initiation time. ## Solution Ensure the transfer number variables (
primary
,
secondary
,
third
) are passed in the
retell_llm_dynamic_variables
field when the call is created, not just referenced in the pr
ompt text.
Copy code
json
{
  "primary": "+4477XXXXXXXX",
  "secondary": "+4474XXXXXXXX",
  "third": "+4478XXXXXXXX"
}
Then reference them in your Transfer Call tool configuration using the
{{variable_name}}
syntax. [(1) ]()
​ To learn more, see the sources I considered: [[1] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) [[2] Populating Dynamic Variables During An Inbound Call](https://discord.com/channels/1186424376300679209/1228587811188379649) [[3] Set & parse custom SIP headers](https://docs.retellai.com/build/telephony/sip-headers) [[4] 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.
g
@AI Evy The variables are coming over as a webhook from make.com I know they're working because the debug node reads out the correct numbers
a
Thanks for the follow-up, @Gza. I'll get back to you soon.
### Answer This is a known issue that has been reported by other users. [(1) ]() The problem is that even though the variables are being received via webhook and the agent can read them in the prompt context (hence your debug node works) , the Transfer Call tool may not be recognizing them as properly populated dynamic variables. ## Potential Workaround Based on a similar case in the community, one user found that including the dynamic variable in the welcome/greeting message caused the agent to properly recognize and use the variable. When they removed it from the greeting, the agent reverted to incorrect behavior. You could try: 1. Adding the transfer number variable to your begin message temporarily (e.g.,
"Transfer number is {{primary}}"
) to see if this resolves the transfer issue 2. If it works, you can make the reference subtle or use it in a way that doesn't expose it to the user ## Proper Variable Setup Dynamic variables should be set in the
retell_llm_dynamic_variables
field and can be used in: [(2) ]() - Prompts - Begin message - Tool configurations (including tool descriptions and transfer call phone numbers) Make sure your webhook response is properly formatting the variables in the
retell_llm_dynamic_variables
object. If the issue persists after trying the workaround, this may require reaching out to Retell support directly as it appears to be a known edge case with variable resolution in tool execution.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://discord.com/channels/1186424376300679209/1340177140204699649) [[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.
g
@AI Evy if I paste the webhook here can you take a look? { "status": "ok", "result": { "retell_llm_dynamic_variables": { "tech1": "{{53.Number}}", "tech2": "{{55.Number}}", "tech3": "{{57.Number}}", "tech4": "{{59.Number}}" } } }
a
Thanks for the follow-up, @Gza. I'll get back to you soon.
### Answer Your webhook response format is incorrect for inbound calls. The response structure needs to be wrapped in
call_inbound
and use
dynamic_variables
instead of
retell_llm_dynamic_variables
. [(1) ]() [(2) ]() Your current format:
Copy code
json
{
  "status": "ok",
  "result": {
    "retell_llm_dynamic_variables": {
      "tech1": "{{53.Number}}",
      ...
    }
  }
}
Correct format for inbound call webhook:
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "tech1": "+14157774444",
      "tech2": "+12137774445",
      "tech3": "+14157774446",
      "tech4": "+12137774447"
    }
  }
}
Two issues to fix: 1. **Wrong wrapper**: For inbound webhooks, variables must be nested under
call_inbound
→
dynamic_variables
, not
result
→
retell_llm_dynamic_variables
2. **Unresolved Make.com variables**: The values
"{{53.Number}}"
etc. appear to be Make.com template placeholders that aren't being resolved before sending. Make sure Make.com is actually substituting those with real phone numbers before the webhook fires. The error
"Transfer destination number is a dynamic variable that's not populated"
occurs because Retell isn't recognizing the variables in that format. [(2) ]()
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Agent not picking up dynamic variables](https://discord.com/channels/1186424376300679209/1395530229640073329) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy Sorry, I did paste the webhook response from make directly. But your comment on formatting makes sense. I'll make those changes and retest
a
Thanks for the follow-up, @Gza. I'll get back to you soon.
### Answer Sounds good! To confirm the correct format, your inbound webhook response should look like this: [(1) ]()
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "tech1": "+4477XXXXXXXX",
      "tech2": "+4474XXXXXXXX",
      "tech3": "+4478XXXXXXXX",
      "tech4": "+4479XXXXXXXX"
    }
  }
}
Make sure Make.com is resolving those
{{53.Number}}
placeholders to actual phone number strings before the response is sent. Once the format is corrected with
call_inbound
→
dynamic_variables
, your Transfer Call tool should properly recognize the populated variables. Let me know how it goes after the changes!
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy this still isn't working. I've stripped the agent workflow right back to basics. The first node collects, sets and sucesfully reads out the variable values as numbers correctly. The flow then goes on to fail to transfer because the dynamic variable is not populated
a
Thanks for the follow-up, @Gza. I'll get back to you soon.
### Answer Given that you've confirmed the agent can read the variable values correctly but the Transfer Call tool still reports the dynamic variable as "not populated," here are a few things to verify: ## Verify Variable Naming Consistency The Transfer Call tool requires the transfer number to be set as a dynamic variable using the
{{variable_name}}
syntax. [(1) ]() [(2) ]() Ensure the exact variable name you're using in your Transfer Call node configuration matches what's being set in your webhook response. For example, if your webhook sets
tech1
, your transfer number field must be
{{tech1}}
exactly. ## Check How Variables Are Being Set Dynamic variables can be used in tool configurations including transfer call phone numbers. However, there's a distinction between: - Variables set at call initiation (via webhook response in
call_inbound
→
dynamic_variables
) - Variables the agent "knows about" in prompt context The Transfer Call tool specifically requires the variable to be formally registered in the dynamic variables collection, not just referenced in a prompt. ## Agent Transfer Variable Persistence Issue A similar issue has been reported where dynamic variables set via webhook weren't being interpolated properly in tool calls after certain flow transitions. In one case, the issue resolved itself after debugging, suggesting it may be intermittent or configuration-dependent. [(3) ]() ## Next Steps Since you've stripped the workflow to basics and it still fails, this may require direct support investigation. You can: - Visit [Contact Sales]() - Check [) Would you like me to
provide a general answer on alternative approaches, or would you prefer to escalate this to Retell support?
​ To learn more, see the sources I considered: [[1] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[3] Dynamic Variables not persisted](https://discord.com/channels/1186424376300679209/1432409107393937589) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@AI Evy I'd like to escalate to support please. I've read a few links here now that indicate it may be a bug
a
Thanks for the follow-up, @Gza. I'll get back to you soon.
### Answer --- Understood. To escalate this issue to Retell support, you can: - Visit [Contact Sales]() - Visit [) When reaching out, include: - Your call IDs showing the issue - Your webhook response format - Confirmation that the agent reads the variables correctly but the Transfer Call tool fails with "Transfer destination number is a dynamic variable that's not populated" This will help them investigate whether there's a bug with dynamic variable interpolation in Transfer Call tool execution.
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.