https://retellai.com/?utm_source=discord&utm_medium=seo logo
i need to pass a user_id that i put in the metadat...
# ❓・ai-evy-support
o
@AI Evy i need to pass a user_id that i put in the metadata of a create call to a custom function webhook. How can I do it?
a
Thanks for tagging me @oreks. I'll look through relevant sources and get back to you shortly.
### Answer To pass a
user_id
from your call metadata to a custom function webhook, you should use dynamic variables (
retell_llm_dynamic_variables
) instead of
metadata
. [(1) ]() The
metadata
field is for storage purposes only and is not used for processing. [(2) ]() However,
retell_llm_dynamic_variables
allows you to inject key-value strings into prompts and tools. [(1) ]() When creating your call, include the
user_id
in `retell_llm_dynamic_variables`:
Copy code
javascript
const registerCallResponse = await retell.call.createPhoneCall({
  from_number: '+14157774444',
  to_number: '+12137774445',
  retell_llm_dynamic_variables: {
    user_id: 'your_user_id_here'
  }
}) ;
Then in your custom function, you can reference this dynamic variable as a parameter. When configuring your function node, you would pass the dynamic variable (e.g.,
user_id
) as a parameter to your webhook. [(3) ]() The webhook will receive the dynamic variable values you pass as parameters in the function configuration.
​ To learn more, see the sources I considered: [[1] Outbound Calls (Make Calls)](https://docs.retellai.com/deploy/outbound-call) [[2] Create Web Call](https://docs.retellai.com/api-references/create-web-call) [[3] I always get 403 in all my function calls on my Function Nodes](https://discord.com/channels/1186424376300679209/1397772634606800976) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
o
I don’t want to share user_id with the llm
a
Appreciate the feedback! Feel free to ask me again with additional guidance or context.
o
@AI Evy I want to pass information to a custom function without sharing it with the llm
a
Thanks for the follow-up, @oreks. I'll get back to you soon.
### Answer Based on the available sources, I don't have explicit documentation showing how to pass data to a custom function webhook without exposing it to the LLM. The sources describe: -
retell_llm_dynamic_variables
– which injects values into prompts and tools (meaning the LLM has access) [(1) ]() -
metadata
– which is for storage purposes only and is not used for processing Neither of these options appears to meet your requirement of passing data to a webhook while keeping it hidden from the LLM. Check out these potentially useful sources: - [Function Calling Overview]() - [Function Node Overview]() For this specific use case, I'd recommend reaching out to: - [Contact Sales]() - [GitHub]() Would you like me to try providing a general answer based on my broader knowledge instead?
​ To learn more, see the sources I considered: [[1] Here is how that can be fixed](https://retell.discourse.group/t/here-is-how-that-can-be-fixed/23) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
o
@AI Evy can I inject it to the llm and tell it to ignore?
a
Thanks for the follow-up, @oreks. I'll get back to you soon.
### Answer Yes, you can use dynamic variables and instruct the LLM to not mention or share specific values with the user. For your custom function, you can use a const value for parameters instead of having the LLM resolve them. When defining parameters, there's a switch to change between "parameter description" or "const value" — const values are applied directly to the function without LLM interpretation. [(1) ]() Here's how you could structure it:
Copy code
json
{
  "type": "object",
  "properties": {
    "last_name": {
      "type": "string",
      "const": "{{last_name}}"
    },
    "order_id": {
      "type": "number",
      "const": 1234
    }
  }
}
Using
"const": "{{user_id}}"
means the dynamic variable value gets passed directly to your webhook without the LLM needing to determine or reason about it. Additionally, for query parameters in your custom function configuration, you can set const values that will be applied directly rather than resolved by the LLM. This approach keeps the
user_id
flowing through to your webhook while minimizing LLM involvement with that specific value.
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.