https://retellai.com/?utm_source=discord&utm_medium=seo logo
if I have an "extract dynamic variable" function t...
# ❓・ai-evy-support
m
@AI Evy if I have an "extract dynamic variable" function to extract the email, for example, and I also add an email text field under post-call analysis, are we talking about exactly the same variable with the same values? how do they differentiate and how do they work together?
a
Thanks for tagging me @mrearthbound. I'll look through relevant sources and get back to you shortly.
### Answer The "Extract Dynamic Variable" function and post-call analysis text fields are two different systems that serve different purposes and timing: Extract Dynamic Variable Function: This tool lets you extract values from a user's response during the call and save them as dynamic variables [(1) ]() . You can create variables of different types including Text, Number, Enum, or Boolean . These variables become available immediately during the call and can be referenced using the
{{variable_name}}
syntax in prompts, begin messages, tool descriptions, and other parts of your agent configuration [(2) ]() . Post-Call Analysis: Post-call analysis automatically analyzes customer conversations after they have ended [(3) ]() . You can extract Text (String) data which provides detailed textual information like call summaries, action items, or key discussion points . This analysis is available after the call ends and you can subscribe to the
call_analyzed
webhook event type to receive it once ready [(4) ]() . Key Differences: 1. **Timing**: Extract Dynamic Variables work during the call, while post-call analysis happens after the call ends [(1) ]() [(3) ]() 2. **Usage**: Dynamic variables can be used immediately in the conversation flow, while post-call analysis is for review and insights [(2) ]() [(3) ]() 3. **Access**: Dynamic variables are accessible via
{{variable_name}}
syntax during the cal
l, while post-call analysis results are available through the call object and webhooks [(2) ]() [(4) ]() Even if you extract the same information (like an email) , these would be stored and accessed differently - one as a dynamic variable for real-time use, and one as post-call analysis data for later review and processing.
​ To learn more, see the sources I considered: [[1] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[3] Post Call Analysis Overview](https://docs.retellai.com/features/post-call-analysis-overview) [[4] Update Call](https://docs.retellai.com/api-references/update-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy i did an extract dynamic variable to extract a phone number, and it seems that the AI just kept calling the function over and over again, and it wouldn't reply anymore
a
Thanks for the follow-up, @mrearthbound. I'll get back to you soon.
### Answer The issue you're experiencing with the AI repeatedly calling the extract dynamic variable function is a known problem that can occur with transition conditions in Conversation Flow [(1) ]() . Based on community discussion, this happens when the transition condition doesn't properly wait for the variable extraction to complete . One user reported that "sometimes the extract variable node transitions to the next node before it has actually extracted the variable" . Here are the recommended solutions: 1. Check your transition condition - Avoid making the transition always true (like
{{variable_name}} = SomeValue
where it's always true) , as this doesn't give the function a chance to extract the variable . 2. Use a proper extraction-based condition - Try setting your transition condition to something like "when the phone number is extracted" rather than an equation that's always true . 3. Consider starting fresh - If you imported your agent from a sample, the sample agents may have incorrect configurations that cause this issue . Creating a new agent from scratch rather than modifying an imported sample has resolved this problem for other users . 4. Verify your custom function setup - Ensure your custom function endpoint is properly configured and returns a response with status code 200-299 [(2) ]() . The function result is capped at 15,000 characters and will be converted to string before sending to the LLM . If the problem persists, you may want to check your function's implementation and ensure it's not getting stuck in a loop due to improper response handling.
​ To learn more, see the sources I considered: [[1] extract variable node transition](https://discord.com/channels/1186424376300679209/1393706083108786357) [[2] 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.
m
@AI Evy where do i add variables to the "custom_analysis_data" that come in on my webhook?
a
Thanks for the follow-up, @mrearthbound. I'll get back to you soon.
results rather than real-time extracted variables.
### Answer Based on the available sources, the
custom_analysis_data
object in webhooks is populated through post-call analysis fields that you define, not through dynamic variables extracted during the call [(1) ]() [(2) ]() . The
custom_analysis_data
appears in the
call_analysis
object when you receive the
call_analyzed
webhook event [(1) ]() [(3) ]() . However, the sources indicate that currently there isn't a direct way to add dynamic variables that were extracted during the call to this field [(4) ]() . From the community discussions, it appears that: 1. Dynamic variables extracted during state transitions are not automatically included in the
custom_analysis_data
field 2. Post-call analysis fields are what populate the
custom_analysis_data
object, but these are analyzed after the call ends rather than being the variables you extracted during the call [(5) ]() 3. The Retell AI team has acknowledged this limitation and added it to their roadmap to provide better visibility for extracted variables in webhooks [(4) ]() Currently, if you need access to extracted dynamic variables, you would need to access them through the
transcript_with_tool_calls
property in the webhook payload, where the variables from previous states are stored as JSON edge arguments [(5) ]() . For now, the
custom_analysis_data
field is specifically for post-call analysis
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[3] Consume the analysis data](https://docs.retellai.com/features/post-call-analysis-consumption) [[4] How to get stored variables via webhook](https://discord.com/channels/1186424376300679209/1232987461781819412) [[5] Passing custom data from call to webhook on call_analysis request](https://discord.com/channels/1186424376300679209/1248010850623819798) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.