Standard library overview

The Workflows standard library defines the built-in functions that can be used in an expression within a workflow. The standard library includes frequently used functions, such as data type and format conversions. There is no need to import or load libraries in a workflow - library functions work out of the box when used inside an expression.

Module: base64

Base64 encoding/decoding.

Functions
encode Encodes given bytes to Base64 text.
decode Decodes given Base64-encoded string to bytes.

Module: errors

Constructors for commonly used exceptions.

Functions
type_error Returns a dictionary object with a TypeError tag.
value_error Returns a dictionary object with a ValueError tag.
index_error Returns a dictionary object with an IndexError tag.
key_error Returns a dictionary object with a KeyError tag.
not_implemented_error Returns a dictionary object with a NotImplementedError tag.
recursion_error Returns a dictionary object with a RecursionError tag.
zero_division_error Returns a dictionary object with a ZeroDivisionError tag.
system_error Returns a dictionary object with a SystemError tag.
timeout_error Returns a dictionary object with a TimeoutError tag.
resource_limit_error Returns a dictionary object with a ResourceLimitError tag.

Module: http

HTTP/S request support.

Functions
http_error Raised when an HTTP request fails with an HTTP error status.
connection_error Raised when an HTTP request fails due to a connection error.
auth_error Returns a dictionary object with an AuthError tag.
get Sends an HTTP GET request to the specified URL.
post Sends an HTTP POST request to the specified URL.
request Makes an HTTP request.
default_retry_predicate Simple default retry predicate for idempotent targets.
default_retry_predicate_non_idempotent Simple default retry predicate for non-idempotent targets.
Objects
default_retry Simple default retry policy for idempotent targets.
default_retry_non_idempotent Simple default retry policy for non-idempotent targets.

Module: json

JSON encoding/decoding.

Functions
encode Encodes given input object to JSON bytes, using UTF-8 charset.
encode_to_string Encodes given object to a JSON string.
decode Decodes given JSON bytes (assuming UTF-8), or a string, into an object.

Module: retry

Support for retries.

Functions
always Convenience retry condition that retries on any error.
never Convenience retry condition that retries on no error at all.
Objects
default_backoff Simple default truncated exponential backoff policy.

Module: sys

Common system interface, with platform-dependent implementation.

Functions
get_env Retrieves the value of the specified environment variable.
sleep Suspend execution for the given number of seconds.
log Writes the specified text to the log at the specified severity.

Module: text

Text processing.

Functions
encode Encodes given text to bytes, using the specified character set.
decode Decodes given data to string, assuming the specified character set.