Properties and errors
Overview#
When defining a workflow, it is necessary to understand the following sets of properties:
Click on each property set for a detailed description.
Workflow properties and error handling#
The Workflow Service handles errors according to the property values set in TaskDef properties.
For error handling, the main properties to consider are:
_retryCount_retryLogic_retryDelaySeconds
RetryCount#
The _retryCount property is an integer value which specifies the number of retries to attempt when a task is marked as failed. This defaults to the value of 3. The maximum value which it can be set is 10.
RetryLogic#
The _retryLogic property is a string which sets the mechanism for performing retries of a task.
The possible values for _retryLogic are:
- FIXED - Reschedule the task after
retryDelaySeconds - EXPONENTIAL_BACKOFF - Reschedule the task after
retryDelaySeconds * (2 ^ attemptNumber). - LINEAR BACK - Reschedule after
retryDelaySeconds * backoffRate * attemptNumber.
RetryDelaySeconds#
The _retryDelaySeconds property is an integer value which specifies the time to wait before retries of a task. This defaults to 60 seconds.
For more information, refer to TaskDef properties below.
WorkflowDef properties#
| Field | Type | Description | Notes |
|---|---|---|---|
_id | UUID | Unique identifier for workflow defintion | |
_name | String | Name of the workflow | |
_description | String | Description of the workflow | |
_userType | String | Identifies class of user | |
_namespaces | Array of string | List of namespaces | |
_taskDefs | Array of task defs | List of tasks associated with the workflow | |
_timeoutSeconds | Integer | The amount of time after which the workflow will be masked as TIMED_OUT. | The value is in seconds. |
_timeoutPolicy | String | Workflow's timeout policy. | Defaults to TIMED_OUT_WF. If set to TIME_OUT_WF then the workflow is marked as TIMED_OUT and terminated. If set to ALERT_ONLY, then a counter is registered - workflow_failure, with status tag set to TIMED_OUT. |
_updatedBy | String | User ID of the user who last updated the workflow | |
_createdBy | String | User ID of the user who created the workflow |
Workflow properties#
| Field | Type | Description | Notes |
|---|---|---|---|
_id | UUID | Unique identifier for the workflow | |
_workflow_def_id | UUID | Unique identifier for the workflow definition | |
_name | String | Name of the workflow | This name needs to be in the class_reference_mapping table (_name field) |
_description | String | Description of the workflow | |
_userType | String | A way to identify a group to workflows. | |
_namespaces | Array of string | List of namespaces | |
_result | JSON | Result of the workflow | |
_context | JSON | Contains the Auth token | |
_status | String | Status of the workflow. | Possible values include: RUNNING, COMPLETED, FAILED, TIMED-OUT, PAUSED and CANCELED |
_timeoutSeconds | Integer | The amount of time after which the workflow will be marked as TIMED_OUT | The value is in seconds. |
_timeoutPolicy | String | Workflow's timeout policy | Defaults to TIMED_OUT_WF. If set to TIME_OUT_WF then the workflow is marked as TIMED_OUT and terminated. If set to ALERT_ONLY, then a counter is registered - workflow_failure, with status tag set to TIMED_OUT. |
_created_at | Integer | Time at which the workflow was created | |
_updated_at | Integer | Time at which the workflow was updated | |
_updated_by | String | User ID of the user who last updated the workflow | |
_createdBy | String | User ID of the user who created the workflow |
TaskDef properties#
| Field | Type | Description | Notes |
|---|---|---|---|
_id | UUID | Unique identifier | |
_workflow_def_id | UUID | Workflow definition ID | |
_name | String | Name of the task | |
_description | String | Description of the task | |
_sequenceno | Integer | Sequence number to define the execution order of tasks | |
_type | String | Type of the task | Example values: SCRIPT_EXECUTION, USER_INPUT |
_inputParams | JSON | Input parameters of the task | |
_retryCount | Integer | Number of retries to attempt which a task is marked as failed. | Defaults to 3. The maximum allowed value is capped at 10. |
_retryLogic | String | Mechanism for the retries | Values are: FIXED - reschedule the task after retryDelaySeconds, EXPONENTIAL_BACKOFF - Reschedule the task after retryDelaySeconds * (2 ^ attemptNumber), and LINEAR BACK - reschedule after retryDelaySeconds * backoffRate * attemptNumber |
_retryDelaySeconds | Integer | Time to wait before retries. | Defaults to 60 seconds |
_timeoutSeconds | Integer | Time in seconds, after which the task is marked as TIMED_OUT if it has not reached a terminal state after transitioning to IN_PROGRESS status for the first time. | No timeout if set to 0 |
_timeoutPolicy | String | Task's timeout policy | Defaults to TIME_OUT_WF. If set to RETRY then it retries the task again. If set to TIME_OUT_WF then the workflow is marked as TIMED_OUT and terminated. This is the default value. If set to ALERT_ONLY then it registers a counter - (task_timeout) |
_responseTimeoutSeconds | Integer | If greater than 0, the task is rescheduled. If it is not greater than 0, it is updated with a status after this time (heartbeat mechanism). Useful when the worker polls for the task but fails to complete due to errors/network failure. | Defaults to 600 |
_result | JSON | Output of the task | |
_decisionCases | Array | Map where the keys are the possible cases with values being lists of tasks to be executed. | Used for SWITCH task |
_forkTasks | JSON | A list of lists of tasks. Each of the outer list will be invoked in parallel. | Used for FORK JOIN task |