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
not Boolean NOT
- Unary minus
*, /, //, % Multiplication, division, floor division, remainder
+, - Addition, subtraction
, <=, >=, >, ==, !=, in Comparison, equality, membership
and Boolean AND
or Boolean 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
INTEGER DOUBLE STRING BOOL
INTEGER INTEGER DOUBLE STRING ERROR
DOUBLE DOUBLE DOUBLE STRING ERROR
STRING STRING STRING STRING STRING
BOOL ERROR ERROR STRING ERROR

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
INTEGER DOUBLE STRING BOOL
INTEGER INTEGER DOUBLE ERROR ERROR
DOUBLE DOUBLE DOUBLE ERROR ERROR
STRING ERROR ERROR ERROR ERROR
BOOL ERROR ERROR ERROR ERROR
* operator
INTEGER DOUBLE STRING BOOL
INTEGER INTEGER DOUBLE ERROR ERROR
DOUBLE DOUBLE DOUBLE ERROR ERROR
STRING ERROR ERROR ERROR ERROR
BOOL ERROR ERROR ERROR ERROR
/ operator
INTEGER DOUBLE STRING BOOL
INTEGER DOUBLE DOUBLE ERROR ERROR
DOUBLE DOUBLE DOUBLE ERROR ERROR
STRING ERROR ERROR ERROR ERROR
BOOL ERROR ERROR ERROR ERROR
<, >, <=, >= comparison operators
INTEGER DOUBLE STRING BOOL
INTEGER BOOL BOOL ERROR ERROR
DOUBLE BOOL BOOL ERROR ERROR
STRING ERROR ERROR ERROR ERROR
BOOL ERROR ERROR ERROR ERROR
==, != comparison operators
INTEGER DOUBLE STRING BOOL NULL
INTEGER BOOL BOOL ERROR ERROR BOOL
DOUBLE BOOL BOOL ERROR ERROR BOOL
STRING ERROR ERROR BOOL ERROR BOOL
BOOL ERROR ERROR ERROR BOOL BOOL
NULL BOOL BOOL BOOL BOOL BOOL