Types of Session Variables
Session variables in your flow can be categorized into several types based on how they are created and managed.
Capture Variables
Section titled “Capture Variables”Capture Variables are automatically captured by the Agent during execution based on the description you provide. The Agent identifies and stores relevant information as the workflow progresses.
Tool-Returned Capture Variables
Section titled “Tool-Returned Capture Variables”These variables are returned by tools during execution, including both custom and predefined tools.
For custom tools, simply return the variables in the capture_variables dictionary, and they will be automatically stored as session variables(each key stored as seperate session variable).
User Variables
Section titled “User Variables”User Variables are defined in the API payload before executing an autonomous or conversational flow. These allow you to pass initial data into your workflow.
System Variables
Section titled “System Variables”The following system variables are automatically set in every session:
workflow_id- A unique identifier assigned to each workflow executioncaller_number- Available during voice calls, containing the caller’s phone numberconversation_history- Available throughout the particular workflow execution
Predefined Tool Variables
Section titled “Predefined Tool Variables”When using predefined tools, the entire output object returned by the tool is saved as a session variable.
Example: Telegram Tool
Section titled “Example: Telegram Tool”
For the telegram.get_chat_member_count tool (from the Telegram integration), the complete output object is stored in the session and can be accessed using dot notation:
telegram.get_chat_member_count.counttelegram.get_chat_member_count.chat_idUsing in Custom Tools
Section titled “Using in Custom Tools”You can access these variables in your custom tools like this:
# Retrieve the entire output objecttelegram_output = inputs.get('telegram.get_chat_member_count')
# Access specific fieldschat_id = telegram_output.get("chat_id")member_count = telegram_output.get("count")
