Variables
Named settings for a workflow, such as a tone or a name. Pick the value once and use it in any neuron as {{vars.id}}.
A variable is a named setting for the whole workflow, such as a tone, a length or a name. You pick its value in the Variables section of the canvas, and use it in any neuron as a reference like {{vars.tone}}. On each run, the reference is replaced with the variable's value at that moment.
A variable means nothing by itself: it's the neurons that reference it that give it a meaning. Only you change a variable, by hand. Runs read it and never change it.
Create a variable
- Open Variables in the left rail of the canvas.
- Click New variable.
- Type a name, for example "Story length", and pick a type.
- Click Create. The variable opens so you can set its value.
The types are:
- Text: any text, up to 2,000 characters.
- Number: any number.
- Single select: one of the choices you add.
- Multi select: any of the choices you add. A reference reads them as a list separated by commas, for example "Space, Kindness".
- Yes/No: a reference reads it as Yes or No.
For a select type, add the choices under CHOICES, then pick the value. Removing the choice that is picked clears the value. A variable can have up to 50 choices, each up to 100 characters.
A workflow can have up to 50 variables, and a name can be up to 100 characters.
Use a variable
Variables work wherever references do: GET text inputs and queued values, the DO Instructions, and the SEND fields Email to, the email's Subject and Body, and Endpoint URL.
- Click in the field.
- Type two opening curly braces (
{{), or click Insert a reference. - Pick the variable from the VARIABLES group. Each one shows its name and its current value.
You can also copy a variable's reference from its ID in the Variables section and paste it into the field.
A variable is text, so it can't fill an input that needs a file or a table.
A variable's text can contain references of its own, such as another variable ({{vars.name}}), an input or the instructions of another neuron. They are filled in too, up to three levels deep. If a variable ends up using itself, or the chain is longer than three levels, the neuron that uses it doesn't run and the message names the reference. Text from Memory, a neuron's result, a dashboard, or an incoming connection, webhook or trigger is never searched for references. See A value can contain references.
Change a variable
Open the variable in the Variables section to change its value, choices, name or type. Changing the type keeps the value where it fits: a single select becomes a multi select with the same choice picked, and text that is one of the choices stays picked when it becomes a single select.
Every change is saved with the workflow and can be undone like any other edit.
Change the ID
The ID is made from the name when you create the variable, and stays the same when you rename it. To change it, click Change under ID, type the new ID and click Save ID. IDs use lowercase letters, numbers and dashes, and two variables can't share one. Every reference to the variable is updated to the new ID.
Delete a variable
Open the variable and click the delete button. The message says how many neurons use it. Their references stop working, and those neurons won't run until you remove the reference or pick another variable.
Show to agent users
Each variable has a Show to agent users setting, on by default. When it is on, each User of your agent picks their own value once, under Preferences in the Settings tab of the Agent page, and their runs use it. When it is off, the variable is hidden from them and your value applies. It doesn't change how your own runs work. See My agents.
Each setup of your agent keeps the variables as they were when it was made. If you later change a variable, or add or remove one, and publish again, setups made before keep their own: only new setups get your changes. A User's value under Preferences stays as they set it.
Common problems
No variable called vars.…
The reference points at a variable that doesn't exist: it was deleted, or the ID was typed wrong. Pick the right one with Insert a reference. A neuron with this problem doesn't run until it's fixed.
Reference IDs are lowercase letters, numbers and dashes
The reference was typed with capitals or underscores, like {{Vars.Tone}}. Use the lowercase form shown in the message.
See also References.