https://retellai.com/?utm_source=discord&utm_medium=seo logo
Can I use Edge JSON for Enum Type variables
# ❓・ai-evy-support
a
Thanks for tagging me @anton333_50203. I'll look through relevant sources and get back to you shortly.
### Answer Based on the documentation, you can create Enum type variables in Retell AI [(1) ]() [(2) ]() . The Enum variable type allows you to define a value from a predefined list with examples like "Yes", "No", "Maybe" . When creating Enum variables, you need to specify Enum Options which are the options to choose from, and this is only required when the variable type is enum . However, regarding Edge JSON specifically for Enum variables in multi-prompt configurations, there's a known issue mentioned in the Discord community where JSON schemas in edges can cause playground errors [(3) ]() . The recommendation is to ensure your JSON schema includes "type": "object" at the top and that "required" keys match exactly, while keeping the schema lean to avoid potential bug-triggering complexity . For the most current information about using Edge JSON with Enum variables specifically, I'd recommend checking the latest documentation or contacting support, as the available sources don't provide explicit details about this specific combination.
​ To learn more, see the sources I considered: [[1] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) [[2] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) [[3] Error in playground when using multi-prompt with json in edges](https://discord.com/channels/1186424376300679209/1351840870835421224) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Another question -- I've noticed that AI executes a function with just 1 required variable when the JSON clearly has 2 required. Why is AI ignoring the required elements?
Another question -- I've noticed that AI executes a function with just 1 required variable when the JSON clearly has 2 required. Why is AI ignoring the required elements? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer The available documentation does not provide an explicit reason why the AI would execute a custom function when only one required variable is provided, even though the JSON schema specifies two required variables [(1) ]() . The sources describe how to define parameters and required fields for custom functions using JSON schema, but do not elaborate on validation behavior or possible reasons for this discrepancy . Check out these potentially useful sources: [Custom Function]() , [Create Retell LLM]() , [Can't Update Agent]() Would you like 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) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Has the community ever mentioned that? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Based on the available sources, there is no mention in the community channels or documentation about the AI executing a function when not all required JSON variables are present. The sources do not provide community reports or discussions about this specific behavior. If you want, I can try to give a general answer based on my knowledge instead. Check out these potentially useful sources: [Function Calling Overview]() , [Response Variables - Part of Future Function Calls in JSON?]() , [Are there any support docs for community node n8n retell "n8n-nodes-retellai" ?]()
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Just to confirm, inbound webhook does not contain call_id, right? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer You are correct. The inbound call webhook payload does not include a call_id. The documentation states that the call is not connected yet and a call object is not created at this stage, so you will not have a call_id inside the payload [(1) ]() .
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
So this is essentially the last thing that takes place before the agent answers and the call id is created? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
### Answer Yes, that's correct. The inbound webhook is triggered before the call is actually connected and before a call object (and thus a call_id) is created. At this stage, you do not have a call_id in the payload because the system hasn't answered or established the call yet. The webhook allows you to process the inbound event and decide how to handle it before the call proceeds to agent connection and call object creation [(1) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
I am extracting some data related to the mobile number type that I receive in the inbound webhook prior to webhook response. Is there any way to access the call id to save this data to the relevant cache that I am using? I don't mind sending another signal. Would maybe using Retell node with agent id show me the current call that that agent is on? or is taht not reliable because the agent could be in theory handling multiple calls or something?
I am extracting some data related to the mobile number type that I receive in the inbound webhook prior to webhook response. Is there any way to access the call id to save this data to the relevant cache that I am using? I don't mind sending another signal. Would maybe using Retell node with agent id show me the current call that that agent is on? or is taht not reliable because the agent could be in theory handling multiple calls or something? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer There is no way to access the call_id at the time you receive the inbound webhook, because the documentation specifies that the call is not yet connected and a call object (and thus call_id) has not been created at this stage [(1) ]() . This means you cannot cache data by call_id before the webhook response. Using the agent_id to look up the current call is not reliable for associating data with a specific call, because an agent can handle multiple calls at the same time . The only time the call_id becomes available is after the call object is created, which happens after the webhook response and the call is connected .
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
a
but i could potentially match the call that the agent is handling with the mobile number that has run through the workflow making it possible to match @AI Evy
a
### Answer It is not reliable to match a call to an agent using only agent_id and mobile number in the context of the inbound webhook. The documentation states that an agent can handle multiple calls at the same time, so there could be several active calls for the same agent_id. The inbound webhook provides the from_number (caller) and agent_id, but the call_id is not created until after the webhook response and the call is connected. Therefore, you cannot guarantee a unique match between the agent and a specific call at this stage [(1) ]() .
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
But I doubt that the same number could be speaking with two different agent instance, meaning when I make the request of ongoing calls for the agent i could just match the number that came via webhook with the ongoing calls list @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer It is not reliable to assume a one-to-one mapping between a phone number and an agent instance at the moment of the inbound webhook. The documentation explains that an agent can handle multiple calls at the same time, so there could be several ongoing calls for the same agent_id, and multiple callers (even the same number calling in quick succession) could be routed to separate agent instances. The inbound webhook only provides the caller’s number and agent_id, but the call_id is not available until after the webhook response and the call is connected. This means you cannot guarantee a unique or accurate match between the inbound webhook’s from_number and an ongoing call list for the agent at this stage [(1) ]() .
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
a
another question, would this payload that is being sent to Retell be enough? [ { "event": "call_inbound", "agent_id": "agent_3d4b74a0f5071cc87499d803a1", "agent_version": 18, "from_number_raw": "+4418XXXXXX", "to_number": "+4474XXXXXX" } ] or the agent needs all those additional webhook details? @AI Evy
a
### Answer The inbound webhook payload that Retell expects when notifying your endpoint looks like this:
Copy code
json
{
  "event": "call_inbound",
  "call_inbound": {
    "agent_id": "agent_12345",
    "from_number": "+12137771234",
    "to_number": "+12137771235"
  }
}
[(1) ]() Key points: - The payload should be an object with an "event" field and a nested "call_inbound" object containing "agent_id", "from_number", and "to_number". - Additional fields like "agent_version" or "from_number_raw" are not documented as required or standard in the official webhook spec. - The agent does not require extra details beyond what is shown in the documented payload for the inbound webhook to function as intended. If your payload structure is not using the nested "call_inbound" object as shown, you should update it to match the documented format for compatibility.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
a
Can I enforce my personal call_id. Like if I would create my own call_id at the inbound webhook stage, would I be able to set JSON schemas so that the agent would pass them along other data during function's run? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer There is no documentation stating that you can enforce your own call_id at the inbound webhook stage and have the agent treat it as the system call_id or pass it through as a first-class identifier in subsequent function calls. The inbound webhook is sent before the Retell system creates the official call object and call_id, and there is no mention of passing custom identifiers through the agent workflow as if they were the system call_id [(1) ]() . While you can define custom fields or variables using JSON schemas in your custom functions, this does not make them equivalent to the system call_id or guarantee they will be handled in the same way by Retell’s infrastructure [(2) ]() . Any custom identifier you create would be treated as a regular variable and not as a unique call identifier within the system.
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[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.
a
That's ok, I understand that the system will treat them as custom identifiers. But it is possible to use them, right?
That's ok, I understand that the system will treat them as custom identifiers. But it is possible to use them, right? @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer Yes, it is possible to use your own custom identifiers as variables in Retell AI workflows. You can define custom fields in your JSON schema for custom functions, and these fields (such as your own call identifier) will be passed as regular variables during function calls. However, they will not be treated as the system call_id and will not have any special handling by the Retell infrastructure—they will simply be available like any other custom variable you define [(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) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
a
Can you define custom headers for post-call signals? @AI Evy
a
### Answer You cannot define custom headers for post-call signals in Retell AI custom functions. The documentation and community messages indicate that while you can set custom headers for SIP calls (inbound, outbound, and transfers) using the SIP header mechanism, you cannot define arbitrary headers for custom function HTTP requests—only the Retell signature header is included by default [(1) ]() [(2) ]() [(3) ]() [(4) ]() .
​ To learn more, see the sources I considered: [[1] Set & parse custom SIP headers](https://docs.retellai.com/build/telephony/sip-headers) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[4] Discord message from @baptiste_agentstudio on 2024-12-18](https://discord.com/channels/1186424376300679209/1294891368505937952/1318943365332471951) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
I need to find out where would be the best and most reliable way to attach my call_id to: the header in the custom function or as a JSON element inside of each of the function? I am trying to avoid doing double-work and I was wondering if there's a way to make this variable global? Right now I've set up my inbound webhook to deliver all of the aditional data that I need but how to make sure that it would be passed with every function call without mentioning it every single time in the JSON as required? Here's an example of the inbound webhook payload: { "call_inbound": { "dynamic_variables": { "user_number": "+4418XXXXX", "user_number_normalized": "+44187XXXXXX", "number_type": "landline", "carrier_name": "BT", "country_code": "GB", "ari_call_id": "call_01e5C4gcXXXXXXXXXXXX" }, "metadata": { "ari_call_id": "call_01e5C4gcXXXXXXXXXXXX", "agent_id_received": "agent_3d4b74a0f50XXXXXXXXX", "to_number": "+4474XXXXXXXX", "lookup_phone_e164": "+4418XXXXXXXX", "source": "ariXXX.inbound.number_check" } } } @AI Evy
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
### Answer There is no way to make a custom variable (such as a custom call_id) global in Retell AI so that it is automatically included in every custom function call without explicitly defining it in the JSON schema for each function [(1) ]() . You must specify your custom variable (e.g., your own call identifier) as a parameter in each function’s JSON schema if you want it passed with every function call . There is no mechanism documented to inject a custom variable into all function calls automatically, nor can you set a custom header for this purpose in custom functions . If you want your identifier available in every function, you need to add it as a required argument in each custom function’s parameter definition. Only the official Retell signature header is included by default, and you cannot define arbitrary custom headers for custom function HTTP requests .
​ 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) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
You are wrong actually, because the headers do accept dynamic variables {{..}}. I know it because I have tested it already
a
Thanks for the follow-up, @anton333_50203. I'll get back to you soon.
a
You are wrong actually, because the headers do accept dynamic variables {{..}}. I know it because I have tested it already @AI Evy
a
### Answer You are correct that in Retell AI custom functions, header values can accept dynamic variables using the {{...}} syntax. The documentation for both Conversation Flow and Single/Multi Prompt custom functions confirms that when defining request headers, you can include dynamic variables (e.g., {{ari_call_id}}) as the value, and these will be populated from your available dynamic variables at runtime [(1) ]() [(2) ]() . So, if you define a header like:
Copy code
X-Custom-Call-ID: {{ari_call_id}}
and {{ari_call_id}} is present in your dynamic variables, it will be substituted automatically when the function is called.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[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.