https://retellai.com/?utm_source=discord&utm_medium=seo logo
In conversational flows, is there a variable I can...
# ❓・ai-evy-support
a
@AI Evy In conversational flows, is there a variable I can use in logic split node to detect when the conversation was routed from another agent using agent transfer function?
a
Thanks for tagging me @aitoolworx. I'll look through relevant sources and get back to you shortly.
### Answer There is no explicit documentation or example in the available sources showing a built-in variable for logic split nodes that directly indicates if the conversation was routed via agent transfer in conversational flows. The official documentation for agent transfer covers how to configure the transfer and which settings persist, but it does not mention a dynamic variable or flag for this purpose [(1) ]() [(2) ]() [(3) ]() . If you need to detect routing via agent transfer, you may need to manage this context yourself, such as by passing a custom dynamic variable during the agent transfer or using prompt instructions, but there is no direct, documented variable for this scenario. Check out these potentially useful sources: [Agent Transfer Node]() , [Agent Transfer]() , [Node Overview]() Would you like a general answer based on my knowledge instead?
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
explain to me exactly how I pass a custom dynamic variable during the agent transfer
a
Thanks for the follow-up, @aitoolworx. I'll get back to you soon.
### Answer To pass a custom dynamic variable during an agent transfer in Retell AI, set the dynamic variable in your agent’s context before triggering the agent transfer. Dynamic variables use the double curly braces syntax (e.g., {{variable_name}}) and are included in prompts, tool configurations, and other agent fields. When the transfer happens, the receiving agent has access to these variables and can use them for logic or personalization [(1) ]() [(2) ]() . Here’s how you do it: 1. Before calling the agent transfer tool, make sure your agent sets or updates the desired dynamic variable (e.g., set a flag like transferred_from_agent = true) . 2. Trigger the agent transfer as usual. 3. The receiving agent can access the dynamic variable using the {{transferred_from_agent}} syntax in prompts or logic splits. Dynamic variables are automatically passed through the agent transfer process, so any value set before the transfer will be available to the next agent. This approach is confirmed by community discussion and aligns with Retell AI’s documented use of dynamic variables for context passing [(1) ]() [(3) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Agent Transfer](https://docs.retellai.com/build/single-multi-prompt/transfer-agent) [[3] Discord message from @arcticemerald on 2025-09-13](https://discord.com/channels/1186424376300679209/1294891368505937952/1416474911546806425) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
How exactly do I set a dynamic variable (e.g., set a flag like transferred_from_agent = true) before the agent transfer takes place?
a
Thanks for the follow-up, @aitoolworx. I'll get back to you soon.
### Answer To set a dynamic variable (such as transferred_from_agent = true) before the agent transfer in Retell AI, include the variable in your agent's context by using the dynamic variables feature. You do this by adding the key-value pair to the dynamic variables object before initiating the transfer. For example, if you are making an outbound call or updating variables in a flow, you would set:
Copy code
json
{
 "transferred_from_agent": "true"
}
This variable will be available to the next agent after transfer. Make sure to use string values, as dynamic variables must be strings [(1) ]() . The variable is set before calling the transfer function, so the receiving agent can access it using {{transferred_from_agent}} in prompts, logic, or flow conditions [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Discord message from @arcticemerald on 2025-09-13](https://discord.com/channels/1186424376300679209/1294891368505937952/1416474911546806425) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
How do I do this while working in the canvas, not API?
a
Thanks for the follow-up, @aitoolworx. I'll get back to you soon.
### Answer When working in the Retell AI canvas (Conversation Flow builder) , you set dynamic variables using nodes and equations, not by direct API calls. To set a flag like transferred_from_agent before agent transfer: 1. Add a Function Node (or similar logic node) just before your Agent Transfer Node in the flow. 2. In that node, configure it to set the dynamic variable by assigning a value like "transferred_from_agent": "true". 3. After this node, add your Agent Transfer Node to hand off the conversation. Dynamic variables set in the flow will be available to the next agent after transfer, and can be accessed as {{transferred_from_agent}} in prompts or conditions. All dynamic variables must be string values [(1) ]() .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
can i create a function that does not have an API endpoint?
a
Thanks for the follow-up, @aitoolworx. I'll get back to you soon.
### Answer Based on the available documentation, when creating a custom function in Retell AI, you are required to specify an endpoint URL that Retell will call to execute your function [(1) ]() . There is no documented way to create a function node or custom function that does not have an API endpoint; the function node is intended to execute either a pre-built or custom function, and custom functions specifically require a valid URL to send the request to [(2) ]() [(1) ]() .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
How do I create a function to set a variable without an endpoint?
a
Thanks for the follow-up, @aitoolworx. I'll get back to you soon.
### Answer Based on the available documentation, you cannot create a "custom function" in Retell AI without specifying an API endpoint; custom functions are designed to call a URL. However, if your goal is simply to set a variable within the Conversation Flow (canvas) without using an external endpoint, you should use a node type meant for variable assignment—such as an Equation Node or similar logic node—instead of a custom function node. These nodes allow you to set or update dynamic variables directly in the flow, without any API calls. You configure the variable assignment within the node, and the new value is available to subsequent nodes in the flow, including after an agent transfer. For more details, see: - [Function Node Overview]() - [Custom Function]() - [Dynamic Variables]() If you need to set a variable, use the appropriate logic or equation node, not a custom function node. Custom function nodes always require an endpoint.
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
@AI Evy so how does retell know what values to choose for the function call in a function node? do i have to extract the variables with the extract variable node first?
a
Thanks for the follow-up, @hintenjoyer. I'll get back to you soon.
### Answer Retell determines what values to use for a function call in a Function Node by extracting the needed information from the conversation as dynamic variables. You typically use the Extract Dynamic Variable Node to pull values (like user inputs or entities) from the conversation and store them as dynamic variables. These variables can then be referenced in your Function Node configuration, either as parameters in the API call or in the request body [(1) ]() [(2) ]() [(3) ]() [(4) ]() . So, yes—if your function needs specific input (for example, a user name or appointment date) , you should extract those variables first with an Extract Dynamic Variable Node, then use them in the function call by referencing the variable (e.g., {{user_name}}) in the Function Node's parameter or body fields .
​ To learn more, see the sources I considered: [[1] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[3] Node Overview](https://docs.retellai.com/build/conversation-flow/node) [[4] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
is it standard to use global nodes for extract dynamic variable node?
a
Thanks for the follow-up, @hintenjoyer. I'll get back to you soon.
### Answer It is not standard or required to use global nodes specifically for Extract Dynamic Variable Nodes in Retell AI conversation flows. Global nodes are intended for scenarios where you want a node (of any type) to be accessible from anywhere in the conversation, such as handling universal events or objections (e.g., "I need to call back later") [(1) ]() . Any node type, including extract variable nodes, can be set as a global node if you want it to be triggered from any point in the flow, but this is a design choice based on your use case rather than a standard practice for extract dynamic variable nodes .
​ To learn more, see the sources I considered: [[1] Global Node](https://docs.retellai.com/build/conversation-flow/global-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
@AI Evy are custom functions https://docs.retellai.com/build/conversation-flow/custom-function webhooks or API requests?
a
Thanks for the follow-up, @hintenjoyer. I'll get back to you soon.
### Answer Custom functions in Retell AI are API requests sent to a specified URL endpoint when the function is called in your conversation flow. You configure these by providing the endpoint URL, HTTP method, headers, and any parameters. When invoked, Retell sends an HTTP request (POST, GET, PATCH, PUT, or DELETE) to your endpoint with the function name and parameters. This process is essentially a webhook mechanism, where your server receives the request and responds accordingly [(1) ]() , [(2) ]() .
​ 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.