Skip to main content
Cover Placeholder Variables let your agent remember and reuse information during a conversation. You can store details like a user’s name and account information, then reference them later to personalize responses or make decisions in your workflow. Variables act as your agent’s short-term memory, helping it keep track of what matters from one step to the next. Variables are set on a per-user basis according to the user_id variable. If your agent is having conversations with ten different users at the same time, variable values are not shared between them.

Creating variables

You can create and manage variables from the Variables tab in the sidebar. Click Add variable in the top right to create a new variable, or click an existing variable to modify it. (image) When creating a variable, you can optionally set a default value. We recommend doing so, as this provides a fallback for your agent to use.

Using variables

Variables can be used inside most text inputs across Voiceflow. To reference a variable, type { followed by the variable name, then select it from the dropdown. (image) For example, you can use variables in an Playbook’s instructions or as parameter values in an API call. You can also use variables inside the Condition step to add logic to your workflows.

Variables in playbooks

Playbooks can only access variables that are explicitly referenced in their instructions. To make a variable available to a playbook, include it using the {variable_name} syntax somewhere in that playbook’s instructions. Variables not referenced in the instructions won’t be visible to the playbook during execution.

Setting variable values

There are several ways to set a variable’s value during a conversation:
  • The Set step or Code step let you assign any string value to a variable.
  • Responses from tools can be captured and stored using the capture response feature.
  • Variables can be set agentically using exit conditions on a Playbook that is accessed through a Playbook step.

Built-in variables

Every project has access to built-in variables that are automatically set when a conversation begins or when certain actions occur.
Variable nameDescriptionExample
user_idThe user’s unique ID, as set through the web chat widget or API. For phone integrations, this is automatically set to the caller’s phone number.example_user or +16471234567
last_utteranceThe previous message sent by the user.My name is Braden and I like cookies.
last_responseThe agent’s most recent response to the user.Hello, I'm an agent! How can I help today?
last_eventInformation about the last event the user triggered. Contains an object, not a string.{"type":"event","payload":{"event":{"name":"buySyrup"}}}
vf_memoryThe last ten user inputs and agent responses as a string, including tool calls.agent: Hey what's up?\nuser: I want to order maple syrup.
vf_nowThe current date and time in a human-readable format. You can modify the timezone in SettingsGeneral.Jan 1, 2025, 16:37
vf_dateThe current date.Jan 1, 2025
vf_timeThe current time.16:37
vf_monthThe current month.January
vf_dayThe current day of the month.1
vf_yearThe current year.2025
vf_user_timezoneThe user’s timezone. Defaults to the project timezone if unavailable.America/Toronto
sessionsThe number of times this user has opened the agent.8
timestampThe UNIX timestamp of when the conversation began.873700668
localeThe user’s locale, detected from their browser.en-CA
platformThe platform your agent is running on.voiceflow