-
Notifications
You must be signed in to change notification settings - Fork 0
Variable
Variables can persist data among nodes in the same flow.
Some nodes provide data outputs, but to use them in other nodes, the node must contain a <return> element with these attributes:
-
name, required string: the data output name (defined by the node) -
as, optional string: your variable name (A-Za-z0-9); same asnameif not specified
Variables can have these scalar types:
boolintfloatstring
In addition, a list of variables can be held in a list (ordered collection of a specific type). by applying the prefix list: to the type, e.g. a list of strings is list:string.
Multiple values of different types can be held in a single variable with a string map (object). A value in an object can be referenced by a ., e.g. var.str references the str value of the object variable named var.
The scope of a variable determines how long the variable persists. The scope is always the innermost subflow in which the variable is declared in. A variable is declared by explicitly adding a <var> element or by a <return> in a node. Since a variable cannot be redeclared in the same scope or an inner scope, a <return> would overwrite a variable if it is already declared in the scope, and a <var> would result in a stratup error if it is already declared.