Workflows should fail only in case of unexpected errors. Explicit error handling with known errors defines the behavior of what should happen in case of errors inside workflows. These errors are “domain-specific” and closely related to the workflows - “Order not found”, or “Item not in inventory”.
Enable error handling in workflows to define the unhappy paths
As a developer, I need to define what should happen in case of an error coming from a service so that the workflow can take remediate actions and end the workflow gracefully.
Workflows can define known domain-specific errors
Errors can be defined externally using a json and inline in the workflow
It’s possible to specify error codes to map domain-specific errors to concrete underlying technical errors.
It’s possible to react onErrors in all supported workflow states
In case of an unexpected error the workflow is aborted with an error.