Skip to main content

Variables

Variables are named configuration values that can differ per environment. Define them once and reuse them across your agents and actions for non-sensitive settings.

Variables vs. Secretsโ€‹

VariablesSecrets
PurposeNon-sensitive configurationSensitive credentials
VisibilityValues visible to team membersValues hidden after creation
ExampleTenant ID, default language, support emailAPI key, OAuth client secret, auth token
Per-environmentYesYes

Use variables for values that are safe to display and share within your team. Use secrets for anything that should remain hidden.

Managing variablesโ€‹

Creating a variableโ€‹

  1. Navigate to Manage > Variables in Studio
  2. Click Add variable
  3. Enter a Variable name (e.g., TENANT_ID, DEFAULT_LANGUAGE)
  4. Enter a value for each environment (Development, Staging, Production)
  5. Click Save

Naming best practices:

  • Use uppercase with underscores (e.g., TENANT_ID)
  • Be descriptive (e.g., DEFAULT_LANGUAGE not LANG1)
  • Include the service name when relevant (e.g., CRM_TENANT_ID)

Editing a variableโ€‹

  1. Find the variable in the list
  2. Click Edit
  3. Update the values for the relevant environments
  4. Click Save

Deleting a variableโ€‹

  1. Find the variable in the list
  2. Click Delete
  3. Confirm deletion

If the variable is still referenced in any agent state instructions or email agent configurations, the deletion will be blocked and you'll see which agents are using it. Remove the references first, then retry the deletion.

Using variables in state instructionsโ€‹

You can reference variables directly in your state instructions using the @ mention feature:

  1. While editing state instructions, type @
  2. Select a variable from the dropdown (variables are shown with a variable icon)
  3. The variable appears as a highlighted chip in the editor

When the agent resolves the instructions, the variable mention is replaced with the Go template syntax {{.static_variables.VARIABLE_NAME}}, which is then filled in with the environment-specific value when the conversation starts.

Using variables in actionsโ€‹

Reference variables in your action request body templates using Go template syntax:

{{.static_variables.VARIABLE_NAME}}

Example: Environment-specific tenant ID

With a variable TENANT_ID set to:

  • Development: acme-dev
  • Staging: acme-staging
  • Production: acme

Your action request body template can reference it:

{
"tenant": "{{.static_variables.TENANT_ID}}",
"order_id": "{{.parameters.order_id}}"
}

When values are filled inโ€‹

Variable values are filled in when the conversation starts based on the environment, and stay the same throughout the call. This differs from other template values:

Template syntaxWhen it's filled inUse for
{{.static_variables.NAME}}When conversation startsEnvironment-specific config
{{.parameters.NAME}}During the conversationValues collected from the caller
{{.variables.NAME}}During the conversationConversation state and context

Because variable values are set at the start, they cannot depend on conversation state โ€” they are fixed for the duration of the call based on the environment.

Per-environment valuesโ€‹

Each variable can have a different value per environment. The correct value is automatically resolved based on the conversation's environment:

This lets you use different identifiers or settings depending on the environment โ€” without changing your action configuration.