https://retellai.com/?utm_source=discord&utm_medium=seo logo
I'm using a custom function in a conversation-flow...
# ❓・ai-evy-support
s
@AI Evy I'm using a custom function in a conversation-flow agent. I'm trying to send some parameters out with the POST request to my server, but all of the fields keep coming up undefined. I have extracted these fields as dynamic variables in the conversation flow and I'm using them in the request, but they still come up undefined: https://cdn.discordapp.com/attachments/1302816169367044149/1442523959722770532/image.png?ex=6925bea0&is=69246d20&hm=4b5f67e18fbc487dcf6e4d5fc75eb8e941c3d88046b667ff75805f86ccaff242&
a
Thanks for tagging me @summerpuppet471. I'll look through relevant sources and get back to you shortly.
### Answer Based on the sources, when dynamic variables aren't being sent correctly in custom function POST requests, the issue is typically in how you're referencing them in the parameter description. [(1) ]() When defining parameters for your custom function, you need to use the double-brace syntax
{{variable_name}}
in the description field of your parameter schema. For example, if you have a dynamic variable called
treatment_id
, your parameter description should be: "Use this as the treatment id: {{treatment_id}}" The custom function will receive parameters in the request body under the
args
field as a JSON object. [(2) ]() [(3) ]() When Retell sends the POST request to your endpoint, it includes: - `name`: the name of the custom function - `call`: the call object for context - `args`: the arguments for the custom function, as a JSON object Make sure you're also verifying that the dynamic variables are being extracted successfully before the custom function is called - you can check this in your call logs. [(1) ]() If you're still experiencing issues after updating your parameter descriptions with the
{{variable_name}}
syntax, ensure the extraction is happening consistently for each call.
​ To learn more, see the sources I considered: [[1] Dynamic Variable is not sending via custom function.](https://discord.com/channels/1186424376300679209/1430715756030722149) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[3] 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.