https://retellai.com/?utm_source=discord&utm_medium=seo logo
quick question, I have been building conversation ...
# ❓・ai-evy-support
a
quick question, I have been building conversation flow agents but find that they are a little too restrictive for what I need. I am essentially buidling an agent for a small handyman company where the agent needs to assess if the requested job is within the scope of provided services and then book an appointment. Also, there's a a function to cancel an existing appointment too. Would multi-prompt agent work better for this type of conversation? Callers are typically asking if we can do the job, and if yes, we the bot should ask for preferred times then book the appointment @AI Evy
a
Thanks for tagging me @anton333_50203. I'll look through relevant sources and get back to you shortly.
### Answer Based on your use case, a multi-prompt agent would likely be a better fit for your handyman company's needs [(1) ]() . Here's why: Multi-prompt agents offer more flexibility - they combine several single prompt agents into a structured tree of fine-tuned prompts, allowing for more complex conversations while maintaining context throughout the flow . This approach demands less rigid structuring compared to conversation flow agents . For your specific scenario - where callers ask if you can do a job and then need appointment booking - a multi-prompt agent would be ideal because it allows the LLM to make decisions about transitioning between different conversation states (service assessment → appointment booking → cancellation) without requiring you to define every possible path . The key difference is that conversation flow provides the most control over dialogue paths but requires you to design intricate conversation structures . Since you're finding conversation flow "too restrictive," multi-prompt gives you a middle ground between the flexibility of single prompt and the precision of conversation flow . Multi-prompt is particularly beneficial when handling multiple topics or tasks within a single session, which matches your use case of service assessment, appointment booking, and cancellation functionality . The multi-prompt method allows you to split your prompts into logical sections - perhaps one node for service assessment, one for booking appointments, and one for cancellations - while still giving the LLM flexibility to navigate between them based on caller needs [(2) ](

▾

) .
​ To learn more, see the sources I considered: [[1] Retell AI’s Advanced Conversation Flow | Retell AI](https://www.retellai.com/blog/unlocking-complex-interactions-with-retell-ais-conversation-flow) [[2] Part 1: BuildYour First Retell Voice Al Agent That Sells Cars](

https://www.youtube.com/watch?v=p0DusrDjfjA▾

) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
I do not understand the difference between functions that you create in the dashboard of the multi-prompt agent and the functions you create in the Tools section when editing an individual node? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Based on the available sources, there are two levels where you can add functions in a multi-prompt agent: Agent-level functions are general functions that can be called from any node in your multi-prompt tree [(1) ]() . These are best for functions you want to use multiple times across different states, like end call functions . Node-level functions (in the Tools section when editing individual nodes) are state-specific functions that are limited to that particular state only . The key difference is scope and reusability : - **Agent-level**: Available throughout the entire conversation flow - **Node-level**: Only available within that specific node/state **Best practice recommendation**: Keep general functions like end call at the agent level, and use node-level functions only when you need functionality that's specific to that particular conversation state . One user mentioned they initially had state-specific functions but realized they could reuse them elsewhere, so they moved all functions to the agent level [(2) ]() .
​ To learn more, see the sources I considered: [[1] Discord message from @_superwhale on 2025-01-24](https://discord.com/channels/1186424376300679209/1294891368505937952/1332171997744205925) [[2] Discord message from @jayzpio on 2025-01-24](https://discord.com/channels/1186424376300679209/1294891368505937952/1332178711369482302) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
What if for example, I want to set a variable like {{price_mentioned}} and if it is set as "true" when price was discussed instruct the agent to "IF {{price_mentioned}} = "true" do NOT mention the price and ask for {{user_name}} only" Where should that variable live on agent's level or in tools?
What if for example, I want to set a variable like {{price_mentioned}} and if it is set as "true" when price was discussed instruct the agent to "IF {{price_mentioned}} = "true" do NOT mention the price and ask for {{user_name}} only" Where should that variable live on agent's level or in tools? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer For your {{price_mentioned}} variable, you would use the Extract Dynamic Variables tool [(1) ]() . This tool lets you extract values from a user's response and save them as dynamic variables . The variable should be created using the Extract Dynamic Variable Tool at the node level where you want to capture whether price was discussed . Here's how to set it up: 1. Add an Extract Dynamic Variable Tool to the appropriate node 2. Add a variable with these details : - **Variable Name**: price_mentioned - **Description**: Whether price was discussed in the conversation - **Variable Type**: Boolean Once extracted, the {{price_mentioned}} variable becomes available throughout your agent for use in prompts and conditional logic . You can then reference it in your prompts across different nodes using the {{price_mentioned}} syntax . The extraction happens at the node level through the tool, but once set, the variable can be referenced in prompts throughout your multi-prompt agent . It's best to include in the prompt explicitly when to invoke the extract variable function .
​ To learn more, see the sources I considered: [[1] 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.
a
So what would be an example of a variable that I would want to keep at the agent's level? Also, if any variable can be referenced throughout the conversation after it has been called at the node level. What's even the point of the Agent level if all functions can be created in Tools and used throughout?
So what would be an example of a variable that I would want to keep at the agent's level? Also, if any variable can be referenced throughout the conversation after it has been called at the node level. What's even the point of the Agent level if all functions can be created in Tools and used throughout? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Based on the available sources, I need to clarify that the sources don't explicitly distinguish between "agent-level variables" and "node-level variables" in the way you're asking about. The documentation shows that dynamic variables are created using the Extract Dynamic Variables tool at the node level [(1) ]() . However, the distinction between agent-level and node-level functions is clear [(2) ]() . The best practice is to keep general functions like end call at the agent level, while state-specific functions are limited to individual nodes . For functions specifically, the agent level serves an important purpose because: Agent-level functions are available throughout the entire conversation and can be called from any node . Examples include: - End call functions that need to be accessible from any conversation state - Functions you want to call multiple times across different prompts Node-level functions are limited to that specific state only . Regarding your question about variables - the sources don't provide clear examples of agent-level variables versus node-level variables. The Extract Dynamic Variables documentation shows variables being created at the node level and then being available throughout the agent [(1) ]() . I don't have sufficient information in the available sources to provide specific examples of agent-level variables or explain the complete distinction between agent-level and node-level variable storage. Would you like me to provide a general answer based on my knowledge, or would you prefer to check the [Extract Dynamic Variables]() do
cumentation directly for more details?
​ To learn more, see the sources I considered: [[1] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) [[2] Discord message from @_superwhale on 2025-01-24](https://discord.com/channels/1186424376300679209/1294891368505937952/1332171725101600880) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Ok, next question, what is an "Edge" thing between nodes and how does it work? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer ### Answer An Edge is a connection between two nodes in a conversation flow that defines the conditions for transitioning from one node to another [(1) ]() . Edges are what control how conversations progress through your flow. How Edges Work: Edges define transition conditions between nodes . When a condition is met during the conversation, the agent will transition to the next node . The connections between nodes are defined by specific conditions, ensuring that the AI only moves to the next step when appropriate criteria are met [(2) ]() . Key Benefits: The edge system allows for Enhanced Node and Transition Definitions where you can define edges and transitions with greater accuracy to create seamless interactions [(3) ]() . This makes it much easier to manage complex conversation flows because you can visually see the edges and how conversations are being transferred from one node to another [(4) ](

▾

) . Visual Management: As one user noted in a workshop, with conversation flow "it is much easier to actually see the edges and how it's being transferred from one node to the other" compared to multi-prompt agents where the flow can become very complex and harder to visualize . Practical Example: If a user asks about product availability, an edge may lead to a node providing stock information [(5) ]() . The edge ensures that conversations flow logically, enhancing user comprehension and satisfaction. This edge-based system is what mak
es conversation flow agents particularly powerful for creating structured, predictable conversation paths while maintaining fine-grained control over the interaction flow.
​ To learn more, see the sources I considered: [[1] Conversation Flow Overview](https://docs.retellai.com/build/conversation-flow/overview) [[2] Guide to AI Hallucinations & How to Fix Them | Retell AI](https://www.retellai.com/blog/the-ultimate-guide-to-ai-hallucinations-in-voice-agents-and-how-to-mitigate-them) [[3] New Conversation Flow Agent, Bot Builders Office Hour](https://www.retellai.com/changelog/new-conversation-flow-agent-bot-builders-office-hour) [[4] Personalization with Airtable](

https://www.youtube.com/watch?v=U8jdhkqOOhE▾

) [[5] Retell AI’s Advanced Conversation Flow | Retell AI](https://www.retellai.com/blog/unlocking-complex-interactions-with-retell-ais-conversation-flow) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
What would be an example of the working "Edge"? For example, in the conversation flow you define the transition with text prompt but in multi-prompt "Edge" is a JSON, so I don't understand how one converts to the other @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer ### Answer Based on the available sources, I can explain the difference between edges in conversation flow and multi-prompt agents: Conversation Flow Edges: An edge is a connection between two nodes that defines the conditions for transitioning from one node to another [(1) ]() . These edges determine how conversations progress based on user interactions [(2) ]() . For example, if a user asks about product availability, an edge may lead to a node providing stock information . Multi-Prompt Agent Edges: The sources show that multi-prompt agents use a different approach. The multi-prompt method combines several single prompt agents into a structured tree of fine-tuned prompts, where each node can contain its own specific prompt and transition logic to other nodes . Key Differences: - **Conversation Flow**: Provides more fine-grained control over dialogue paths, allowing developers to create intricate conversation structures that guide users through various scenarios effectively - **Multi-Prompt**: Uses transition logic within nodes rather than explicit edge definitions Practical Implementation: One user noted that with conversation flow, "it is much easier to actually see the edges and how it's being transferred from one node to the other" compared to multi-prompt agents where the flow can become very complex and harder to visualize [(3) ](

▾

) . However, the available sources don't provide specific examples of JSON edge configurations for multi-prompt agents or detailed examples of how text prompts convert to JSON edge conditions. The sources focus more on the conceptual differences between the two approaches rather than the technical implem
entation details you're asking about. For specific JSON edge examples and conversion details, you may need to check the official documentation directly or contact support.
​ To learn more, see the sources I considered: [[1] Conversation Flow Overview](https://docs.retellai.com/build/conversation-flow/overview) [[2] Retell AI’s Advanced Conversation Flow | Retell AI](https://www.retellai.com/blog/unlocking-complex-interactions-with-retell-ais-conversation-flow) [[3] Personalization with Airtable](

https://www.youtube.com/watch?v=U8jdhkqOOhE▾

) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Just checking something. I got this message from ChatGPT, is it accurate? "You create a tool once in the Functions tab. From that moment it is a “global tool” and the LLM can call it from any state. A state’s Tools panel is only for adding extra, state-specific tools or for editing the global one’s settings; it does not copy or duplicate the tool. If you try to give a new tool the same name as an existing global one, Retell shows “Tool name must be unique …” and blocks the save docs.retellai.com . Dynamic-variable values that a tool sets (via Extract Dynamic Variable or a custom function) live for the whole call, so later prompts can read them without re-extracting." ?
@AI Evy Just checking something. I got this message from ChatGPT, is it accurate? "You create a tool once in the Functions tab. From that moment it is a “global tool” and the LLM can call it from any state. A state’s Tools panel is only for adding extra, state-specific tools or for editing the global one’s settings; it does not copy or duplicate the tool. If you try to give a new tool the same name as an existing global one, Retell shows “Tool name must be unique …” and blocks the save docs.retellai.com . Dynamic-variable values that a tool sets (via Extract Dynamic Variable or a custom function) live for the whole call, so later prompts can read them without re-extracting." ?
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Based on the available sources, I can verify parts of that ChatGPT message: What's accurate: - General functions at the agent level can be called from any state throughout the conversation [(1) ]() - State-specific functions are limited to that particular state only - Dynamic variables, once extracted, are available throughout the agent for use in prompts and conditional logic [(2) ]() - The Extract Dynamic Variables tool lets you extract values from a user's response and save them as dynamic variables What I cannot verify from the sources: - The specific behavior about tool name uniqueness and the exact error message "Tool name must be unique" - The detailed mechanics of how the state's Tools panel interacts with global tools - Whether state tools panels are for "editing global tool settings" versus creating new tools What the sources do confirm: The best practice is to keep general functions like end call at the agent level, and use state-specific functions only when needed for that particular conversation state [(1) ]() . Once dynamic variables are extracted using the Extract Dynamic Variable Tool, they become available throughout your multi-prompt agent [(2) ]() . The sources don't provide the level of technical detail about tool management that ChatGPT described, so I cannot fully verify the accuracy of those specific claims about how the Functions tab and state Tools panels interact.
​ To learn more, see the sources I considered: [[1] Discord message from @jayzpio on 2025-01-24](https://discord.com/channels/1186424376300679209/1294891368505937952/1332171569828724797) [[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.
a
Do I need to use an "Edge" with JSOn schema to transfer {{user_name}} from one multi-prompt node to another? Like if the agent asked for the name during greeting, would it be automatically known throughout the whole conversation or do I need to write the JSOn schema @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer ### Answer Based on the available sources, once you extract a dynamic variable like {{user_name}} using the Extract Dynamic Variables tool, it becomes available throughout your multi-prompt agent without needing JSON schema in edges [(1) ]() . How it works: 1. Use the Extract Dynamic Variables tool in the node where you want to capture the user's name 2. Set up the variable with these details : - **Variable Name**: user_name - **Description**: The name of the user - **Variable Type**: Text Automatic availability: Once extracted, the {{user_name}} variable becomes available throughout your agent for use in prompts and conditional logic . You can reference it in prompts across different nodes using the {{user_name}} syntax without needing to transfer it via JSON schema. Best practice: It's recommended to include in the prompt explicitly when to invoke the extract variable function . For example:
Copy code
When user states his name and phone number, please extract the information by calling the `extract_user_details` function.
No JSON schema needed: The sources don't indicate that you need JSON schema in edges to transfer dynamic variables between multi-prompt nodes. The Extract Dynamic Variables tool handles the persistence of these variables throughout the conversation automatically . The variable extraction happens at the node level through the tool, but once set, the variable can be referenced in prompts throughout your multi-prompt agent .
​ To learn more, see the sources I considered: [[1] 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.
a
so what's the point of the edge JSOn schema then? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer ### Answer Based on the available sources, I can see that JSON schema is used in edges for multi-prompt agents, but the sources don't provide a comprehensive explanation of their specific purpose. From the Discord discussion, one user experienced issues when using JSON schema in multi-prompt edges [(1) ]() . The user reported getting a 500 Internal Server Error when trying to use JSON values in edges, with an example showing:
Copy code
json
{
    "type": "object",
    "properties": {
        "appointment_id": {
            "type": "string",
            "description": "ID of the existing appointment to cancel. This can be found in the customer record appointment array."
        }
    },
    "required": [
        "appointmentId"
    ]
}
However, the user noted that when they removed the JSON schema from the edge, it worked, but it had worked at one point previously . The sources show that JSON schema is used extensively in custom functions for defining parameters [(2) ](

▾

) [(3) ](

▾

) [(4) ](

▾

) [(5) ]() , but they don't clearly explain the specific purpose of JSON schema in multi-prompt edges versus the automatic variable persistence through Extract Dynamic Variables. The available sources don't provide sufficient detail about the specific use cases and purposes of JSON schema in multi-prompt edges. For a complete understanding of when and why to use JSON schema in edges, you may need to check the official documentation directly or contact support.
​ To learn more, see the sources I considered: [[1] Error in playground when using multi-prompt with json in edges](https://discord.com/channels/1186424376300679209/1351840870835421224) [[2] Live Workshop: Retell x GoHighLevel Integration](

https://www.youtube.com/watch?v=TlzrfYgiPLQ▾

) [[3] MASTER THE FUTURE OF VOICE AI - Never Miss Another Appointment](

https://www.youtube.com/watch?v=Fpw3Yrg3JoY▾

) [[4] Live Workshop: Retell x GoHighLevel Integration](

https://www.youtube.com/watch?v=TlzrfYgiPLQ▾

) [[5] Tool set up help request](https://discord.com/channels/1186424376300679209/1302850935160180756) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Quick question, when setting up an "inbound webhook" to fill the user's number that the caller is calling from should I create {user_number} as a variable in tools or at the agent level?
Quick question, when setting up an "inbound webhook" to fill the user's number that the caller is calling from should I create {user_number} as a variable in tools or at the agent level? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer ### Answer For an inbound webhook setup, {{user_number}} is actually a system default dynamic variable that's automatically provided by Retell AI [(1) ]() . You don't need to create it manually at either the agent level or in tools. System Default Dynamic Variables Available: Retell AI provides {{user_number}} as a built-in variable that represents the user phone number (inbound: from_number, outbound: to_number) . This is available automatically for phone calls only . Inbound Webhook Implementation: Based on the workshop example, when setting up an inbound webhook, you can directly use {{user_number}} in your webhook response without creating it manually [(2) ](

▾

) . The inbound webhook receives the phone number information and you can reference it in your dynamic variables response [(3) ](

▾

) :
Copy code
json
{
  "call_inbound": {
    "override_agent_id": "{{1.call_inbound.agent_id}}",
    "dynamic_variables": {
        "customer_name": "{{2.`0`}}",
       "info": "{{2.`8`}}"
    },
    "metadata": {
        "random_id": "12345"
    }
  }
}
[(4) ]() Key Point: The inbound webhook is configured at the phone number level, not the agent level [(5) ]() . When someone calls, the webhook receives the phone number data automatically, and {{user_number}} becomes available as a system variable throughout the conversation [(1) ]() . So you don't need to create {{user_number}} anywhere - it's automatically provided by Retell AI's system for inbound calls .
​ To learn more, see the sources I considered: [[1] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[2] Personalization with Airtable](

https://www.youtube.com/watch?v=U8jdhkqOOhE▾

) [[3] Personalization with Airtable](

https://www.youtube.com/watch?v=U8jdhkqOOhE▾

) [[4] Inbound Webhook](https://discord.com/channels/1186424376300679209/1351497865318633522) [[5] Inbound call webhook ui not visiable. I only see agent webhook,](https://discord.com/channels/1186424376300679209/1382092411009761310) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
when creating an agent level function, do I instruct the agent to call for it the same way as with "tools" by writing "call "flagged_question" @AI Evy ?
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Yes, you instruct the agent to call agent-level functions the same way as tools [(1) ]() . In the Discord discussion, a community member provided an example of how to instruct the agent to call a function in the prompt: "Thanks and have good one, call function end_call_143 to end this call" The same user also suggested adding a number to help the AI identify it as a function: "Also use call function end_call_152 give it a number so AI can identify it as function" . Best Practice: General functions like end call should be kept at the agent level, while state-specific functions are limited to individual nodes . Agent-level functions can be called from any state throughout the conversation, whereas state functions are limited to that specific state only . So whether the function is at the agent level or node level, you use the same "call function [function_name]" syntax in your prompts to instruct the agent when to invoke it.
​ To learn more, see the sources I considered: [[1] Discord message from @_superwhale on 2025-01-24](https://discord.com/channels/1186424376300679209/1294891368505937952/1332171725101600880) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
If I am using a function at the agent level in multi-prompt type, do I write the instructions to call it in the global prompt or inside of the individual node? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer For multi-prompt agents, you can write function call instructions in both the global prompt and individual nodes [(1) ]() . The best practice is to keep general functions like end call in the main prompt, while functions that you want to call multiple times can be placed in either the global prompt or within individual multi-prompt nodes . Global Prompt Usage: You would put the function call instructions in the global prompt when the function needs to be accessible across all states in your multi-prompt agent [(2) ](

▾

) [(3) ](

▾

) . For example, global state prompts are where you set the identity, core principles, and global rules for the agents . Individual Node Usage: You can also include function call instructions within specific nodes when the context of that particular state makes the function call more relevant or when you want to provide state-specific guidance on when to call the function. Example from the sources: As shown in the Discord discussion, you would instruct the agent with something like: "Thanks and have good one, call function end_call_143 to end this call" [(1) ]() . The same approach applies whether the instruction is in the global prompt or individual nodes. The key is that agent-level functions are available throughout the entire conversation and can be called from any node, while state functions are limited to that state specifically .
​ To learn more, see the sources I considered: [[1] Discord message from @_superwhale on 2025-01-24](https://discord.com/channels/1186424376300679209/1294891368505937952/1332171725101600880) [[2] Speed to Lead: Driving Results with Outbound Facebook Campaigns](

https://www.youtube.com/watch?v=9fgelfy6kQA▾

) [[3] Speed to Lead: Driving Results with Outbound Facebook Campaigns](

https://www.youtube.com/watch?v=9fgelfy6kQA▾

) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
What is MCPs that just appeared in multi prompt today @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer I don't have information about "MCPs" appearing in multi-prompt today based on the available sources. The sources I have access to don't mention any feature called "MCPs" or any recent updates specifically from today. The sources discuss multi-prompt agents as a structured tree of prompts where each node can contain its own specific prompt, custom function calling instructions, and clear transition logic to other nodes [(1) ]() . They also mention that multi-prompt agents divide the prompt into various states, each with its own prompt, linked by conditional edges [(2) ]() [(3) ]() . I'd be happy to help you understand more about multi-prompt agents in general, but for information about this specific new feature "MCPs," you might want to: - Check the [Platform Changelogs]() directly for the most recent updates - Visit [Contact Sales]() - Visit [) Would you like me to provide a general answer about multi-prompt agents based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Prompt Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[2] Introducing Retell LLM Beta](https://www.retellai.com/changelog/introducing-retell-llm-beta) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
provide an example of the inbound webhook JSOn schema @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer ### Answer Here are examples of the inbound webhook JSON schema from the official documentation: Sample Request Payload (what Retell sends to your webhook) : [(1) ]()
Copy code
json
{
 "event": "call_inbound",
 "call_inbound": {
 "agent_id": "agent_12345",
 "from_number": "+12137771234",
 "to_number": "+12137771235"
 }
}
Sample Response Schema (what your webhook should return) :
Copy code
json
{
 "call_inbound": {
 "override_agent_id": "agent_12345",
 "override_agent_version": 1,
 "dynamic_variables": {
 "customer_name": "John Doe"
 },
 "metadata": {
 "random_id": "12345"
 }
 }
}
Key Points: - The webhook expects a JSON response with successful status code (2xx) with fields grouped under
call_inbound
- All response fields are optional - Available fields include
override_agent_id
,
override_agent_version
,
dynamic_variables
, and
metadata
Additional Example from Community: [(2) ]()
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      // dynamic variables here in a dict
    },
    "metadata": {
      //add metadata here in a dict
    },
  }
}
The webhook response structure must have
dynamic_variables
and
metadata
as dictionaries within the
call_inbound
object .
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] inbound webhook](https://discord.com/channels/1186424376300679209/1352358246371037276) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
How would I set Basic Auth for Agent-level webhook that is triggered at the end of the conversation? I don't see any query parameters like I do in custom functions @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer ### Answer Based on the available sources, agent-level webhooks don't have the same query parameter and header configuration options that custom functions do [(1) ]() . Agent-level webhook configuration: Agent-level webhooks are configured using the
webhook_url
parameter [(2) ]() [(3) ]() . You can set this when creating or updating an agent:
Copy code
json
{
  "webhook_url": "<https://webhook-url-here%22>
}
Custom function authentication options: Custom functions provide more authentication flexibility, allowing you to set request headers and query parameters [(1) ]() . For custom functions, you can define custom headers to include with the request, and header values can be static or include dynamic variables . Agent-level webhook limitations: The sources show that agent-level webhooks are triggered for call events (call.started, call.ended, call.analyzed) [(4) ]() [(5) ]() , but they don't provide configuration options for Basic Auth headers or query parameters like custom functions do. Webhook verification: For security, agent-level webhooks include an
X-Retell-Signature
header for request verification [(1) ]() :
Copy code
javascript
if (
  !Retell.verify(
    JSON.stringify(req.body) ,
    process.env.RETELL_API_KEY,
    req.headers["x-retell-signature"] as string,
  )
) {
  console.error("Invalid signature") ;
  return;
}
The available sources don't show how to configure Basic Auth specifically for agent-level webhooks. For detailed authentication configuration options for agent-level webhooks, you may need to: - Visit [Contact Sales]() - Visit [) Would you like me to provide a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Create Agent](https://docs.retellai.com/api-references/create-agent) [[3] Update Agent](https://docs.retellai.com/api-references/update-agent) [[4] Webhook](https://www.retellai.com/glossary/webhook) [[5] How to trigger Agent-level Webhook only when call has ended?](https://discord.com/channels/1186424376300679209/1270019654718459905) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy sure
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer The available sources don't provide specific information about configuring Basic Auth for agent-level webhooks. What the sources confirm: Agent-level webhooks are triggered for call events (call.started, call.ended, call.analyzed) [(1) ]() [(2) ]() , and they're configured with a webhook URL [(3) ]() . The webhook will always fire for all three events, and you need to filter for the specific event you want in your endpoint [(1) ]() . Webhook security: For webhook verification, Retell includes signature verification capabilities, but the sources don't detail Basic Auth configuration specifically for agent-level webhooks [(3) ]() . Alternative approaches mentioned: - You can use platforms like Make.com to handle webhook filtering and routing [(1) ]() - The agent-level webhook sends the full call transcript in the end_call webhook [(2) ]() - Some users have experienced 403 errors with agent-level webhooks, which were typically configuration issues on the receiving server side [(4) ]() For specific Basic Auth configuration for agent-level webhooks, you may need to: - Visit [Contact Sales]() - Visit [) Would you like me to provide a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] How to trigger Agent-level Webhook only when call has ended?](https://discord.com/channels/1186424376300679209/1270019654718459905) [[2] Discord message from @fyodor2572 on 2024-11-30](https://discord.com/channels/1186424376300679209/1186462578310910112/1312299326638395394) [[3] Webhook](https://www.retellai.com/glossary/webhook) [[4] Agent-level webhook returning 403 after call_ended](https://discord.com/channels/1186424376300679209/1314024215791276103) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy I don't insist on using Basic Auth if the agent-level webhook does not support it however, how to add security to it?
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Based on the available sources, here are the security options for agent-level webhooks in Retell AI: Webhook Signature Verification [(1) ]() The primary security method for agent-level webhooks is signature verification. Retell AI includes an
X-Retell-Signature
header with each webhook request that you can verify:
Copy code
javascript
// install the sdk: <https://docs.retellai.com/get-started/sdk>
import { Retell } from "retell-sdk";
import express, { Request, Response } from "express";
const app = express() ;
app.use(express.json() ) ;
app.post("/webhook", (req: Request, res: Response) => {
 const {event, call} = req.body;
 switch (event) {
 case "call_started":
 console.log("Call started event received", call.call_id) ;
 break;
 case "call_ended":
 console.log("Call ended event received", call.call_id) ;
 break;
 case "call_analyzed":
 console.log("Call analyzed event received", call.call_id) ;
 break;
 default:
 console.log("Received an unknown event:", event) ;
 }
 // Acknowledge the receipt of the event
 res.status(204) .send() ;
}) ;
Additional Security Measures [(2) ]() Retell AI implements enterprise-grade security features including: - End-to-end encryption for voice streams - Comprehensive audit logging - Role-based access controls - Automated compliance monitoring IP Verification [(3) ]() You can also implement IP verification to ensure requests come from authorized Retell servers. The authorized Retell server IPs are: 13.248.202.14, 3.33.169.178 Webhook URL Configuration [(4) ]() [(5) ]() Agent-level webhooks are configured using the
webhook_url
parameter when creating or updating agents:
Copy code
json
{
  "webhook_url": "<https://webhook-url-here%22>
}
The webhook signature verification is the recommended security approach for agent-level webhooks, as it ensures the authenticity of requests from Retell AI without requiring Basic Auth configuration [(1) ]() .
​ To learn more, see the sources I considered: [[1] Setup guide](https://docs.retellai.com/features/register-webhook) [[2] Enterprise-Grade Security for AI Voice Agents | Retell AI | Retell AI](https://www.retellai.com/blog/enterprise-ai-calling-security) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[4] Create Agent](https://docs.retellai.com/api-references/create-agent) [[5] Update Agent](https://docs.retellai.com/api-references/update-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
what agent variables are in the system by default? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Retell AI provides several default system variables that are automatically available - no configuration required [(1) ]() : Available for all calls: -
{{current_agent_state}}
- Current state name (for multi-state agents) -
{{previous_agent_state}}
- Previous state name -
{{current_time}}
- Current time in
America/Los_Angeles
-
{{current_time_[timezone]}}
- Current time in specified timezone, for example:
{{current_time_Australia/Sydney}}
-
{{current_calendar}}
- 14-day calendar in
America/Los_Angeles
-
{{current_calendar_[timezone]}}
- 14-day calendar in specified timezone, for example:
{{current_calendar_Australia/Sydney}}
-
{{call_type}}
- Call type,
web_call
or
phone_call
Available for phone calls only: -
{{direction}}
- Call direction,
inbound
or
outbound
-
{{user_number}}
- User's phone number (from_number for inbound, to_number for outbound) -
{{agent_number}}
- Agent's phone number (to_number for inbound, from_number for outbound) Additional system variables mentioned in changelog: -
{{current_time}}
- current time in America/Los_Angeles (Monday, March 24, 2025 at 02:53:01 PM PDT) [(2) ]() -
{{current_time_[timezone]}}
- current time in given timezone -
{{call_type}}
- web_call or phone_call -
{{direction}}
- inbound or outbound (for phone calls only) -
{{user_number}}
- user phone number (inbound: from_number, outbound: to_number) -
{{agent_number}}
- agent phone number (inbound: to_number, outbound: from_number) These system variables are automatically provided by Retell and don't need to be configured in your agent settings [(1) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Simulation Testing Now Live for All Agents](https://www.retellai.com/changelog/simulation-testing-now-live-for-all-agents-c27zh) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.