A workflow reads the workspace's global variables, and can have its own. Its own win over a global one of the same name, for that workflow only. The designer's Variables panel shows both, with the value each has where this workflow tests.
Who can do this
- Everyone in the workspace can open the panel and see every value — nothing in a variable is secret.
- Admins and Editors add, change and delete this workflow's own variables, on Starter and above.
- Only workspace Admins change global variables, in Settings › Variables.
Steps
- Open the workflow in the designer.
- Select ⋯ at the top right, then Variables. The panel Variables for this workflow opens, with a count such as 1 of its own · 4 global.
- To add one, select + Add variable under This workflow's own. The New variable drawer opens.
- In Name, type a name in lower_snake_case — letters, numbers and _, for example approval_limit.
- Under Type, choose:
- Text — A value your workflows read in any expression field.
- Connection — A connection your steps use, chosen per environment. Credentials stay in Connections — a variable only points at one. Then choose the service in Provider.
- Optional: add a Description, shown to anyone picking the variable.
- Under Production, enter the value (or choose the connection).
- Under Development, enter the sandbox value — or tick Same as Production.
- Select Save variable.
A toast says approval_limit saved — Workflows read the new value on their next run. For a live workflow it adds This workflow is live, so its next run uses it.
To change one, select Edit (the pencil) on its row. To delete one, select Delete (the bin), then Delete variable.
Using a variable
- In a setting, type
{{ $vars.approval_limit }}, or type{{and pick it under VARIABLES. - As a step's connection, choose a Connection variable in the step's Connection list, under Variables (vars › crm · follows the environment). Under the list, In Development this uses HubSpot sandbox. says which connection the test environment gives it.
What happens next
- Changes take effect on the next run, the live version included. There is no need to publish.
- Deleting one of its own that overrode a global: This workflow reads the global … again instead, from its next run. Otherwise: Steps of this workflow that read it will fail until you add it back or edit them.
Good to know
- Each row shows the value where this workflow tests — Values shown are for Development …. A missing one reads No Development value.
- An overridden global is marked Overridden here; the workflow's own is marked Overrides the global ….
- Numbers and true/false are read as their type:
18is a number,truea yes/no. - Passwords and API keys never go in a variable. They stay in Connections.
- Exported files carry variables: Text ones with their values, Connection ones as their service and name only.
- See Variables and environments for global variables.
If something goes wrong
| What you see | Why | What to do |
|---|---|---|
| + Add variable is not there | You are a Viewer, or the plan has no environments and variables. | Ask an Admin or Editor, or move to Starter or above. |
| Use lower_snake_case — letters, numbers and _, starting with a letter. | The name has capitals, spaces or other marks. | Rename it, for example approval_limit. |
| Keep the name to 64 characters. | The name is too long. | Shorten it. |
| A step shows … is not a variable in this workspace. | It reads a variable that does not exist, or was deleted. | Add the variable, or edit the step. |