Set Variable
Set Variable
The Set Variable flow element creates or updates a variable that can be referenced later in the flow.
This is useful for storing values like flags, counters, or dynamically generated text for use in conditional logic or file paths.
Variable
The name of the variable to set.
- Supports variable substitution using
{VariableName}
syntax - The resolved name must:
- Start with a letter (
a-z
,A-Z
) or underscore (_
) - Contain only letters, numbers, underscores (
_
), and dots (.
) - Not start with a digit or a dot
- Not contain spaces or special characters
- Start with a letter (
✅ Examples of valid names:
flag
count.total
result_{StepNumber}
→ becomesresult_2
ifStepNumber=2
❌ Examples of invalid resolved names:
1start
.hidden
invalid name
danger
After substitution, the final name must match the pattern:
^[a-zA-Z_][a-zA-Z0-9_\.]*$
Value
The value to assign to the variable.
- Also supports variable substitution using
{VariableName}
- The final value is automatically cast to the appropriate type:
Input Value | Stored As |
---|---|
true / false | Boolean |
123 | Integer |
12.34 | Float |
Anything else | String |
🔁 Example:
If Username = bob
, and you set:
- Variable:
user.{Username}
- Value:
active_{Username}
Then this will store a variable named user.bob
with the value "active_bob"
(string).