https://retellai.com/?utm_source=discord&utm_medium=seo logo
why sometimes variable that is defined in function...
# ❓・ai-evy-support
q
@AI Evy why sometimes variable that is defined in function is updated but there was no instruction to update variable?
a
Thanks for tagging me @q40478. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, there's a known issue where variables can be updated without explicit instructions, particularly when using webhooks and the Extract Dynamic Variables tool [(1) ]() . The most relevant case documented involves variables (Name, Phone Number, Email) being updated during a conversation flow . When a customer updates details after initial confirmation, the system may acknowledge the change but still use the original values for final operations like booking appointments . Common scenarios where this occurs: 1. Extract Dynamic Variables tool - When you add an Extract Dynamic Variable Tool with variable types (Text, Number, Enum, or Boolean) , the agent can extract and update values from user responses [(2) ]() . The tool may extract new values even when not explicitly instructed to do so if the user provides information matching the variable description . 2. Timing and sequence issues - Variables may get updated at unexpected times if the update step and the booking/action step run in parallel rather than sequentially [(1) ]() . To ensure variables update correctly: - Update variables (name, email, phone) before the booking step - Use the updated values when making the booking request - Ensure booking runs after confirmation/update — not in parallel - Include explicit prompts about when to invoke the extract variable function, for example: "When user states his name and phone number, please extract the information by calling the
extract_user_details
function" [(2) ]() If you're experiencing unexpected variable updates, check your conversation fl
ow to ensure proper sequencing and that your Extract Dynamic Variables tool descriptions accurately reflect when extraction should occur .
​ To learn more, see the sources I considered: [[1] Issue with Webhook Variable Updates Not Reflecting in Final Booking](https://discord.com/channels/1186424376300679209/1346475664181559348) [[2] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.