https://retellai.com/?utm_source=discord&utm_medium=seo logo
before you end the call, trigger function "send_da...
# ❓・ai-evy-support
t
@AI Evy before you end the call, trigger function "send_data" and report the data my retell ai prompt is not properly triggering to send over my data to my custom function so tha tmy webhook recieves it, how can i gauruntee this will send every time
a
Thanks for tagging me @trill_og.sol. I'll look through relevant sources and get back to you shortly.
### Answer To ensure your custom function triggers reliably, you need to explicitly instruct the LLM in your prompt when to call the function [(1) ]() . The documentation recommends including specific instructions about when to invoke your custom function . Here's what you should add to your prompt:
Copy code
When the call is about to end, please call the `send_data` function to report all collected data.
For guaranteed execution, make sure your custom function is properly configured with: 1. Clear function description - Define exactly what data should be sent 2. Required parameters - Mark essential data fields as required in your JSON schema 3. Proper agent version - Ensure your published agent version matches what's assigned to your phone number [(2) ]() If you're still experiencing issues, verify that: - Your agent is published and the correct version is selected - The custom function parameters match exactly what your webhook expects - Your webhook URL is correctly configured and accessible [(1) ]() The LLM can call custom functions at any point during the conversation, including right before call termination [(3) ]() . The key is being explicit in your prompt about when and why the function should be triggered [(1) ]() .
​ 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) [[2] Retell does not send full custom function to webhook](https://discord.com/channels/1186424376300679209/1426299918208733215) [[3] Calling Webhooks In The Middle of A Call](https://discord.com/channels/1186424376300679209/1376986877927886979) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.