Skip to main content

Try

Serves as a mechanism within workflows to handle errors gracefully, potentially retrying failed tasks before proceeding with alternate ones.

Properties

NameTypeRequiredDescription
trymap[string, task]yesThe task(s) to perform. This will be run as a child workflow.
catchcatchyesConfigures the errors to catch and how to handle them.

Example

document:
dsl: 1.0.0
namespace: zigflow
name: example
version: 0.0.1
do:
- user:
export:
as: user
try:
- getUser:
call: http
export:
as: user
with:
method: get
endpoint: https://jsonplaceholder.typicode.com/users/2000
catch:
do:
- setError:
export:
as: error
set:
message: some error

This outputs:

{
"user": {
"error": {
"message": "some error"
}
}
}

Definitions

Catch

Defines the configuration of a catch clause, which a concept used to catch errors.

Properties

NameTypeRequiredDescription
domap[string, task]yesThe definition of the task(s) to run when catching an error. This will be run as a child workflow.