Raise
Intentionally triggers and propagates errors. By employing the "Raise" task, workflows can deliberately generate error conditions, allowing for explicit error handling and fault management strategies to be implemented.
Properties
| Name | Type | Required | Description |
|---|---|---|---|
| raise.error | error | yes | Defines the error to raise. |
Example
document:
dsl: 1.0.0
namespace: zigflow
name: example
version: 0.0.1
timeout:
after:
minutes: 1
do:
- wait:
wait:
seconds: 1
- bug:
raise:
error:
type: https://serverlessworkflow.io/spec/1.0.0/errors/communication
status: 400
Error
Defines the Problem Details RFC compliant description of an error.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| type | uri-template | yes | A URI reference that identifies the error type. For cross-compatibility concerns, it is strongly recommended to use Standard Error Types whenever possible. Runtimes MUST ensure that the property has been set when raising or escalating the error. |
| status | integer | yes | The status code generated by the origin for this occurrence of the error.For cross-compatibility concerns, it is strongly recommended to use HTTP Status Codes whenever possible. Runtimes MUST ensure that the property has been set when raising or escalating the error. |
| instance | string | no | A JSON Pointer used to reference the component the error originates from.Runtimes MUST set the property when raising or escalating the error. Otherwise ignore. |
| title | string | no | A short, human-readable summary of the error or a runtime expression |
| detail | string | no | A human-readable explanation specific to this occurrence of the error or a runtime expression |
Standard Error Types
Standard error types serve the purpose of categorizing errors consistently across different runtimes, facilitating seamless migration from one runtime environment to another.
| Type | Status¹ | Description |
|---|---|---|
| https://serverlessworkflow.io/spec/1.0.0/errors/configuration | 400 | Errors resulting from incorrect or invalid configuration settings, such as missing or misconfigured environment variables, incorrect parameter values, or configuration file errors. |
| https://serverlessworkflow.io/spec/1.0.0/errors/validation | 400 | Errors arising from validation processes, such as validation of input data, schema validation failures, or validation constraints not being met. These errors indicate that the provided data or configuration does not adhere to the expected format or requirements specified by the workflow. |
| https://serverlessworkflow.io/spec/1.0.0/errors/expression | 400 | Errors occurring during the evaluation of runtime expressions, such as invalid syntax or unsupported operations. |
| https://serverlessworkflow.io/spec/1.0.0/errors/authentication | 401 | Errors related to authentication failures. |
| https://serverlessworkflow.io/spec/1.0.0/errors/authorization | 403 | Errors related to unauthorized access attempts or insufficient permissions to perform certain actions within the workflow. |
| https://serverlessworkflow.io/spec/1.0.0/errors/timeout | 408 | Errors caused by timeouts during the execution of tasks or during interactions with external services. |
| https://serverlessworkflow.io/spec/1.0.0/errors/communication | 500 | Errors encountered while communicating with external services, including network errors, service unavailable, or invalid responses. |
| https://serverlessworkflow.io/spec/1.0.0/errors/runtime | 500 | Errors occurring during the runtime execution of a workflow, including unexpected exceptions, errors related to resource allocation, or failures in handling workflow tasks. These errors typically occur during the actual execution of workflow components and may require runtime-specific handling and resolution strategies. |
¹ Default value. The status code that best
describes the error should always be used.