https://retellai.com/?utm_source=discord&utm_medium=seo logo
--- can a fucntion output be shared between states
# ❓・ai-evy-support
j
@AI Evy --- can a fucntion output be shared between states? STATE 1 call function fetch calendar availability - STATE 2 needs that output - even state 3 how is this done?
a
Thanks for tagging me @japhetgan. I'll look through relevant sources and get back to you shortly.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer Based on the available sources, I don't have specific information about how function outputs are shared between states in multi-prompt agents. The documentation mentions that multi-prompt agents include "Context Preservation" where "Variables and information flow between states" [(1) ]() , but the exact mechanism for sharing function outputs across states isn't detailed in these sources. The sources show that function nodes can be configured to "wait for result" to ensure the function result is ready before transitioning to the next node [(2) ]() , but don't explain how that result data persists and gets accessed in subsequent states. For your specific use case of fetching calendar availability in STATE 1 and using that output in STATE 2 and STATE 3, I'd recommend checking the complete multi-prompt documentation or contacting support for the exact implementation details. Would you like me to try to provide a general answer based on common patterns in conversational AI systems, or would you prefer to explore the official documentation further? Support options: - Visit [Contact Sales]() - Visit [)
​ To learn more, see the sources I considered: [[1] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[2] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) ​
j
Im seeing this in the platform Store Call Info as Variables (Optional) Convert information from the previous node into variables for use in future nodes. This should be the JSON schema that defines the format in which the LLM will return @AI Evy
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer The "Store Call Info as Variables" feature you're seeing is mentioned in the Discord discussions [(1) ]() . This feature allows you to extract values from function responses and save them as dynamic variables for use later in the conversation [(2) ]() . For Custom Functions in Conversation Flow, you can set response variables by extracting values from the API response and saving them as dynamic variables . These variables can then be referenced later using the
{{variable_name}}
format . According to the Discord discussion, you can use dynamic variables inside the JSON of future function calls [(3) ]() . So if you get
clientName
back from a "search_customer" function, you can then use
{{clientName}}
inside the JSON for another future function . The Custom Function documentation shows an example where you can extract a user's name from the response and reference it later using
{{user_name}}
[(2) ]() . Here's the example response format:
Copy code
json
{
 "properties": {
 "user": {
 "name": "John Doe",
 "age": 26
 }
 }
}
This means for your calendar availability use case, you could: 1. In STATE 1: Call your fetch calendar availability function and store the results as response variables 2. In STATE 2 & 3: Reference those stored variables using the
{{variable_name}}
syntax in subsequent function calls or conversation nodes However, one Discord user noted that the "Store Call Info as Variables" option that was present in multi-prompt mode is not present in Conversation Flow mode [(1) ]() , suggesting this might be a feature difference between the two approaches.
​ To learn more, see the sources I considered: [[1] Discord message from @micheldenizob on 2025-02-05](https://discord.com/channels/1186424376300679209/1186462578310910112/1336749960045002884) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[3] Response Variables - Part of Future Function Calls in JSON?](https://discord.com/channels/1186424376300679209/1396550506347761686) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.