Data types, functions, operators

The Workflows syntax supports the following data types:

  • Integer (64 bit, signed)
  • Double (64 bit, signed floating point number)
  • String (UTF‑8 encoding, maximum length)
  • Boolean (true/false, True/False, TRUE/FALSE)
  • Bytes (see Returning bytes)
  • Null

Data type functions

The Workflows standard library includes functions to convert, format, and operate on data types. For details, see Standard library overview.

Returning bytes

Bytes can't be returned by a workflow as they can't be JSON-encoded. You can encode bytes to Base64 text. You can also decode JSON bytes into an object. Bytes can be used as the body of HTTP requests. For more information, see Make an HTTP request.

Logical operators

Logical operators can be used only on boolean values, or on expressions that evaluate to boolean values. For examples, see the Syntax cheat sheet.

The following logical operators can be lower-case or upper-case (but not mixed-case):

  • and: logical AND
  • or: logical OR
  • not: logical NOT

Order of operations

The following table is arranged in descending order of precedence of operators. Parentheses () have the highest precedence (most binding) while the or operator has the lowest precedence (least binding).

OperatorDescription
()Parentheses
.Access object property
[]Access list element
notBoolean NOT
-Unary minus
*, /, //, %Multiplication, division, floor division, remainder
+, -Addition, subtraction
, <=, >=, >, ==, !=, inComparison, equality, membership
andBoolean AND
orBoolean OR

Implicit data type conversions

These tables show the outcome of expressions using the given operator and the following data types as inputs. For example, using the + operator on two strings results in a string.

+ operator
INTEGERDOUBLESTRINGBOOL
INTEGERINTEGERDOUBLESTRINGERROR
DOUBLEDOUBLEDOUBLESTRINGERROR
STRINGSTRINGSTRINGSTRINGSTRING
BOOLERRORERRORSTRINGERROR

In the case of integer or double addition, overflow can occur if the resulting value exceeds the available precision. During string concatenation, if the resulting string exceeds the allowed length of the string data type, the operation throws an error.

- operator
INTEGERDOUBLESTRINGBOOL
INTEGERINTEGERDOUBLEERRORERROR
DOUBLEDOUBLEDOUBLEERRORERROR
STRINGERRORERRORERRORERROR
BOOLERRORERRORERRORERROR
* operator
INTEGERDOUBLESTRINGBOOL
INTEGERINTEGERDOUBLEERRORERROR
DOUBLEDOUBLEDOUBLEERRORERROR
STRINGERRORERRORERRORERROR
BOOLERRORERRORERRORERROR
/ operator
INTEGERDOUBLESTRINGBOOL
INTEGERDOUBLEDOUBLEERRORERROR
DOUBLEDOUBLEDOUBLEERRORERROR
STRINGERRORERRORERRORERROR
BOOLERRORERRORERRORERROR
<, >, <=, >= comparison operators
INTEGERDOUBLESTRINGBOOL
INTEGERBOOLBOOLERRORERROR
DOUBLEBOOLBOOLERRORERROR
STRINGERRORERRORERRORERROR
BOOLERRORERRORERRORERROR
==, != comparison operators
INTEGERDOUBLESTRINGBOOLNULL
INTEGERBOOLBOOLERRORERRORBOOL
DOUBLEBOOLBOOLERRORERRORBOOL
STRINGERRORERRORBOOLERRORBOOL
BOOLERRORERRORERRORBOOLBOOL
NULLBOOLBOOLBOOLBOOLBOOL