In addition to the standard library modules , Workflows supports a number of other built-in helper functions such as for data type and format conversions.
For examples, see the Syntax cheat sheet .
Conversion functions
Convert values from one data type to another.
| Functions | |
|---|---|
double()
|
Accepts an attribute of type string or integer and returns a double. |
int()
|
Accepts an attribute of type string or double and returns an integer. |
string()
|
Accepts an attribute of type integer, double, or boolean and returns a string. |
Data type functions
Operate on lists, maps, and strings.
in()
keys()
len()
Computes the length of a value according to its type. Accepts an attribute of type list, map, or string and returns an integer.
- A listreturns the number of elements in the list.
- A mapreturns the number of key-value entries stored in the map.
- A stringreturns the number of characters in the string.
Conditional functions
Support conditions within expressions.
default(val, defaultVal)
Returns a value if it is not null; otherwise returns a default value.
- If not
null,valis returned. - If
valisnull,defaultValis returned.
You can use default
with the standard library function, map.get
,
to safely access optional values in a map, returning null if the key is
not found. For an example, see Read map
values
.
You can also use default
to access optional runtime
arguments, and return a default value if the key is not found. For an
example, see Access runtime arguments
.
if(condition, ifTrue, ifFalse)
Evaluates a condition and returns one of two arguments depending on what the condition evaluates to.
- If
conditionevaluates to true,ifTrueis returned. - If
conditionevaluates to false ornull,ifFalseis returned.
Note that arguments passed to if
are always evaluated
and that the function does not control processing flow. To
conditionally execute an expression, use a switch
statement. For more information, see Conditions
.
Type functions
Return data type.
| Functions | |
|---|---|
get_type(arg)
|
Returns a string indicating the data type of If the operand is a function or a subworkflow,
a |

