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
| Variables | Secrets | |
|---|---|---|
| Purpose | Non-sensitive configuration | Sensitive credentials |
| Visibility | Values visible to team members | Values hidden after creation |
| Example | Tenant ID, default language, support email | API key, OAuth client secret, auth token |
| Per-environment | Yes | Yes |
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
- Navigate to Manage > Variables in Studio
- Click Add variable
- Enter a Variable name (e.g.,
TENANT_ID,DEFAULT_LANGUAGE) - Enter a value for each environment (Development, Staging, Production)
- Click Save
Naming best practices:
- Use uppercase with underscores (e.g.,
TENANT_ID) - Be descriptive (e.g.,
DEFAULT_LANGUAGEnotLANG1) - Include the service name when relevant (e.g.,
CRM_TENANT_ID)
Editing a variable
- Find the variable in the list
- Click Edit
- Update the values for the relevant environments
- Click Save
Deleting a variable
- Find the variable in the list
- Click Delete
- 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:
- While editing state instructions, type
@ - Select a variable from the dropdown (variables are shown with a variable icon)
- 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.
Reserved Stellar variables
Some variables are provided automatically by the platform under the stellar. prefix. You don't create or manage these, and you can't use that prefix for your own variables: keys starting with stellar. are rejected when variables are supplied at conversation start.
Current date and time
Every voice and chat conversation receives stellar.current_datetime, so the agent always knows the current date and time without calling an action. It is localized to the language the conversation runs in, falling back to English for languages that have no localized day and month names.
| Part | Example |
|---|---|
formatted | maandag, 5 januari 2026, 16:04 (Europe/Amsterdam time zone, CET, UTC+1) |
day_of_week | maandag |
date | 5 januari 2026 |
time | 16:04 |
timezone | Europe/Amsterdam |
language | nl |
Reference a single part in an action request body using Go template syntax:
{{.variables.stellar.current_datetime.date}}
The value is captured once, when the conversation starts, and is not updated as the call goes on. Conversations are short enough that the minute stays accurate for the parts of the conversation that matter; for anything that must be exact later in a long call, have the agent call an action instead. If the agent switches language mid-conversation, the already-captured names stay in the original language, and the language part records which language they are in.
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 syntax | When it's filled in | Use for |
|---|---|---|
{{.static_variables.NAME}} | When conversation starts | Environment-specific config |
{{.parameters.NAME}} | During the conversation | Values collected from the caller |
{{.variables.NAME}} | During the conversation | Conversation 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:
- Playground sessions: Uses the environment selected in the environment selector.
- Phone calls: Uses the environment configured on the connector.
- Public links / SDK: Uses the environment associated with the public access token.
This lets you use different identifiers or settings depending on the environment — without changing your action configuration.