set_variable operation
The set_variable operation assigns an value to a variable in a specified scope. The scope can be either project or local.
Project scope variables persist after flow execution, while local scope variables exist only during the flow execution.
For more information on variables and scopes, see the Variables section.
Parameters:
id(type: str, optional) - Unique identifier of the operation in the flowset(type: Dict, required) - Dictionary that defines variables to set, supporting two syntax forms:- Compact form: the
setis a Dict[str, str] mapping variable names to values. In this syntax, variables are automatically set in theprojectscope. - Extended form: the
setis a Dict[str, object] where each object has two properties:valueandscope. The scope can be eitherprojectorlocal.
- Compact form: the
- op: set_variable
id: set_var1
set:
"var1": "value1" # Project scope variable - persists after flow execution
"var2": { # Local scope variable - temporary during flow execution
value: "value2",
scope: "local"
},
"var3": { # Explicitly set project scope
value: "value3",
scope: "project"
}Last updated on