https://retellai.com/?utm_source=discord&utm_medium=seo logo
I want to configure an outbound call agent
# ❓・ai-evy-support
t
@AI Evy I want to configure an outbound call agent. This agent receives the contents of the previous call in the variable {{summary}}. I want the agent to briefly recapitulate the contents of the {{summary}}. How do I achieve this? What do I need for a prompt?
a
Thanks for tagging me @tacitus_16379. I'll look through relevant sources and get back to you shortly.
### Answer To configure an outbound call agent that recapitulates a previous call summary using the
{{summary}}
variable, you'll need to use Retell's dynamic variables feature in your agent prompt [(1) ]() . Here's how to structure your prompt to achieve this: Prompt Structure: Include instructions in your general prompt that reference the
{{summary}}
variable and specify how the agent should use it. For example: "You are a follow-up call agent. At the beginning of the call, briefly summarize the previous conversation using this information: {{summary}}. Start by saying something like 'I'm calling to follow up on our previous conversation where we discussed [brief recap of {{summary}}].' Then proceed with the purpose of this call." Implementation: When making the outbound call, pass the summary data through the
retell_llm_dynamic_variables
parameter [(1) ]() [(2) ]() :
Copy code
javascript
const phoneCallResponse = await client.call.createPhoneCall({
  from_number: '+14157774444',
  to_number: '+12137774445',
  retell_llm_dynamic_variables: {
    "summary": "Customer expressed interest in premium plan, discussed pricing concerns, requested callback about implementation timeline"
  }
}) ;
Key Points: - The
{{summary}}
variable will be dynamically injected into your prompt at runtime [(1) ]() - Structure your prompt to naturally incorporate the summary at the beginning of the conversation - You can store call summaries from previous interactions and pass them as dynamic variables for follow-up calls [(3) ]() This approach allows your agent to provide context-aware follow-up calls that reference previous conversation details.
​ To learn more, see the sources I considered: [[1] Outbound Calls (Make Calls)](https://docs.retellai.com/deploy/outbound-call) [[2] How can I create an outbound call](https://retell.discourse.group/t/how-can-i-create-an-outbound-call/132) [[3] Discord message from @archdesignconcept_00787 on 2025-01-20](https://discord.com/channels/1186424376300679209/1294891368505937952/1330819156563464234) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
t
@AI Evy Okay, in this case, the variable also contains information that the agent shouldn't disclose (for example, the phone number or the best time to reach them). How do I get the agent to summarize the data from the variable {{summary}} again?
a
Thanks for the follow-up, @tacitus_16379. I'll get back to you soon.
### Answer To handle selective disclosure from the
{{summary}}
variable while filtering out sensitive information like phone numbers or contact preferences, you can use specific prompt instructions that guide the agent on what to include and exclude from the summary [(1) ]() . Prompt Structure with Filtering Instructions: Structure your prompt to explicitly instruct the agent on what information to share and what to omit:
Copy code
"You are a follow-up call agent. At the beginning of the call, provide a brief summary of our previous conversation using this information: {{summary}}. 

IMPORTANT: When summarizing, only mention:
- The main topics discussed
- Customer interests or concerns raised
- Next steps or commitments made
- Product/service details covered

DO NOT mention or reference:
- Phone numbers
- Best times to call
- Personal contact preferences
- Internal notes or codes
- Any sensitive personal information

Start with something like: 'I'm calling to follow up on our previous conversation where we discussed [filtered summary content].' Then proceed with the purpose of this call."
Alternative Approach - Pre-process the Summary: You could also clean the summary data before passing it to the dynamic variable by removing sensitive information in your application logic before setting the
retell_llm_dynamic_variables
[(1) ]() [(2) ]() :
Copy code
javascript
// Clean the summary before passing to the call
const cleanedSummary = originalSummary
  .replace(/\+?\d{1,3}[\s-]?\(?\d{3}\) ?[\s-]?\d{3}[\s-]?\d{4}/g, '[PHONE REDACTED]')
  .replace(/best time to call|contact preference/gi, '[CONTACT INFO REDACTED]') ;

const phoneCallResponse = await client.call.createPhoneCall({
  from_number: '+14157774444',
  to_number: '+12137774445',
  retell_llm_dynamic_variables: {
    "summary": cleanedSummary
  }
}) ;
The prompt-based approach is generally more flexible since it allows the LLM to intelligently filter content while maintaining conversational flow [(1) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] How can I create an outbound call](https://retell.discourse.group/t/how-can-i-create-an-outbound-call/132) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
t
@AI Evy Unfortunately, if I implement it this way, the variable's contents aren't returned. I get: "You called, and it was about a summary of the previous conversation. How can I help you?"
a
Thanks for the follow-up, @tacitus_16379. I'll get back to you soon.
### Answer Based on the issue you're experiencing where the
{{summary}}
variable isn't being populated, this appears to be a common dynamic variables problem. Let me help you troubleshoot this. Debugging Steps: First, verify that the dynamic variable is being received by temporarily adding it to your begin message to test if the agent is getting the correct value [(1) ]() . In your agent settings, try setting the begin message to:
Copy code
"Hello, I'm calling to follow up. Previous conversation summary: {{summary}}"
This will help confirm whether the variable is being passed correctly [(1) ]() [(2) ]() . Common Issues and Solutions: 1. **Variable Format**: Ensure all values in
retell_llm_dynamic_variables
are strings [(1) ]() . For outbound calls, use this format:
Copy code
javascript
{
  "summary": "Customer discussed premium plan pricing and requested follow-up call"
}
2. **API Implementation**: For outbound calls, set variables in the
retell_llm_dynamic_variables
field when using the Create Phone Call API [(1) ]() [(3) ]() :
Copy code
javascript
const phoneCallResponse = await client.call.createPhoneCall({
  from_number: '+14157774444',
  to_number: '+12137774445',
  retell_llm_dynamic_variables: {
    "summary": "Your cleaned summary content here"
  }
}) ;
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Dynamic Variables](https://discord.com/channels/1186424376300679209/1340177140204699649) [[3] How can I create an outbound call](https://retell.discourse.group/t/how-can-i-create-an-outbound-call/132) [[4] Dynamic Variables](https://discord.com/channels/1186424376300679209/1356680357084135558) ​
3. **Missing Variable Handling**: When a dynamic variable has no assigned value, it remains in its raw form with curly braces intact [(1) ]() . If you're seeing "summary of the previous conversation" instead of the actual content, the variable likely isn't being set properly. **Alternative Approach**: Some users have reported success using the inbound webhook format for dynamic variables [(4) ]() . If the standard approach isn't working, you could try structuring your variable setting differently in your implementation. **Verification**: Test with a simple, short summary first to ensure the basic functionality works before adding complexity with filtering logic [(1) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
t
@AI Evy No, unfortunately, that doesn't work at all! In the test case, I assigned the variable {{summary}} to "Ms. Vogt, who has statutory insurance, would like to pick up her finished, altered insole on Monday without an appointment." This information should be reproduced. I only receive (during the test): I'm calling back on behalf of the practice. - Was there any mention of a response regarding a desired appointment in the previous conversation?
a
Thanks for the follow-up, @tacitus_16379. I'll get back to you soon.
### Answer Based on your issue where the dynamic variable
{{summary}}
isn't being used despite being set correctly, this appears to be a known problem where the agent doesn't take the variables during API calls but works in testing [(1) ]() . Troubleshooting Steps: 1. **Verify Variable Placement**: Ensure the
{{summary}}
variable is placed directly in your main agent prompt, not just referenced indirectly [(2) ]() . The spaces around the variable name will be trimmed when evaluating the variable . 2. **Test with Simple Prompt**: Create a very simple test where the agent just speaks the dynamic variables to isolate the issue [(1) ]() . Try a prompt like:
Copy code
"You are a follow-up agent. Start every call by saying: The summary from our previous conversation is: {{summary}}. Then ask how you can help."
3. **Check API Implementation**: For outbound calls, ensure you're setting variables correctly in the
retell_llm_dynamic_variables
field [(2) ]() [(3) ]() :
Copy code
javascript
const phoneCallResponse = await client.call.createPhoneCall({
  from_number: '+14157774444',
  to_number: '+12137774445',
  retell_llm_dynamic_variables: {
    "summary": "Ms. Vogt, who has statutory insurance, would like to pick up her finished, altered insole on Monday without an appointment."
  }
}) ;
4. **Alternative Solution**: One user reported success using the inbound webhook format for dynamic variables [(1) ]() :
Copy code
javascript
return {
  "call_inbound": {
    "dynamic_variables": {
      "summary": "Ms. Vogt, who has statutory insurance, would like to pick up her finished, altered insole on Monday without an appointment."
    }
  }
}
**Default Behavior Check**: When a dynamic variable has no assigned value, it remains in its raw form with the curly braces intact [(2) ]() . Since you're seeing a generic response instead of the variable content, this suggests the variable isn't being processed at all. Try the simple test approach first to confirm whether the variable is being received, then gradually add complexity once the basic functionality works.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://discord.com/channels/1186424376300679209/1356680357084135558) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[3] How can I create an outbound call](https://retell.discourse.group/t/how-can-i-create-an-outbound-call/132) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
t
@AI Evy Is it possible that the content of the variable is not displayed in the text chat test, but only in the audio test?
a
Thanks for the follow-up, @tacitus_16379. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Dynamic Variables Don't Populate in Chat-Only Test Mode (Multi-Prompt Agent)](https://discord.com/channels/1186424376300679209/1421373431781396580) ​
### Answer Yes, you've identified the exact issue! Based on the available sources, there is indeed a documented problem where dynamic variables don't populate in chat-only test mode but do work during voice testing [(1) ]() . A Discord forum post specifically reports this issue: "the dynamic variables don't get assigned during testing via chat. however, they do get populated during voice testing" . The user demonstrated that while dynamic variables were being extracted and assigned (visible in debug messages) , they weren't being substituted in the actual chat output during testing . The forum discussion shows that when testing via chat mode, variables like
{{appointment_start_date}}
remained as literal text with curly braces instead of being replaced with their actual values, even though the same variables worked correctly when manually specified at the agent level . **Solution**: Test your dynamic variables using voice/audio testing instead of the chat interface to verify they're working correctly . The chat test mode appears to have limitations with dynamic variable substitution that don't affect actual voice calls. This explains why you're seeing generic responses like "I'm calling back on behalf of the practice" instead of your specific summary content during chat testing, even though your variable assignment appears correct.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.