Skip to content

Commit

Permalink
Merge pull request #860 from RizaFarheen/main
Browse files Browse the repository at this point in the history
Handling Failures doc update
  • Loading branch information
RizaFarheen authored Feb 7, 2025
2 parents bed7913 + 38aef2b commit 7a130f7
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
41 changes: 37 additions & 4 deletions docs/developer-guides/error-handling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ For tasks, you can configure the following resilience parameters in its task def

For workflows, you can configure the following resilience parameters in its workflow definition:

- Timeouts
- Compensation flows (known as failure workflow in Conductor)
- Rate limits

:::note
To deal with workflow failures post-execution, refer to [Debugging Workflows](/developer-guides/debugging-workflows).
Expand Down Expand Up @@ -219,10 +221,41 @@ To configure tasks with no rate limits, set `rateLimitPerFrequency` and `concurr
// task definition
{
"name": "someTaskDefName",
"pollTimeoutSeconds": 3600,
"responseTimeoutSeconds": 600,
"timeoutSeconds": 3600,
"timeoutPolicy": "TIME_OUT_WF"
"rateLimitPerFrequency": 0,
"rateLimitFrequencyInSeconds": 1,
"concurrentExecLimit": 0
}

```

## Workflow timeouts

A workflow can be configured to timeout in situations where:

- The workflow has been running longer than expected and is not completed within the defined time frame.
- An external dependency required by the workflow is unresponsive or taking too long to respond.
- Business logic requires the workflows to be completed within a strict time limit to maintain efficiency.

### Timeout configuration​

You can configure timeout behavior for workflow in its **workflow definition**. The parameters for a workflow’s timeout behavior are:

- Timeout seconds
- Timeout policy

| Parameter | Description | Required/Optional |
| ------------------- | --------------------------------------- | ----------------- |
| timeoutSeconds | Time (in seconds), after which the workflow will be set as TIMED_OUT if it hasn't reached a terminal state. No timeout occurs if the value is set to 0. | Required. |
| timeoutPolicy | The policy for handling workflow timeout. Supported values:<ul><li>**TIME_OUT_WF**–The workflow is set to TIMED_OUT and is terminated.</li><li>**ALERT_ONLY**–Increments the counter to check the workflow status when it times out and logs relevant messages.</li></ul> | Optional. |

**Example**

```json
// workflow definition
{
"name": "someWorkflow",
"timeoutPolicy": "TIME_OUT_WF",
"timeoutSeconds": 1800
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Creates a new workflow definition.
| inputSchema | The schema parameters to be used as input schema for the workflow definition. Learn more about [creating and using schemas](https://orkes.io/content/developer-guides/schema-validation). | object | Required if _enforceSchema_ is set to _true_. |
| schemaVersion | The current version of the Conductor schema. Must be 2. | integer | Required. |
| restartable | Whether the workflow can be restarted after completion. Set to _false_ if restarting could impact workflow functionality. | boolean | Optional. |
| timeoutSeconds | Time (in seconds), after which the workflow will be set as TIMED_OUT if it hasn't reached a terminal state. No timeout occurs if the value is set to 0. | integer | Required. |
| timeoutPolicy | The policy for handling workflow timeout. Supported values:<ul><li>**TIME_OUT_WF**-The workflow is set to TIMED_OUT and is terminated.</li><li>**ALERT_ONLY**-Increments the counter to check the workflow status when it times out and logs relevant messages.</li></ul> | string | Optional. |
| [timeoutSeconds](https://orkes.io/content/error-handling#workflow-timeouts) | Time (in seconds), after which the workflow will be set as TIMED_OUT if it hasn't reached a terminal state. No timeout occurs if the value is set to 0. | integer | Required. |
| [timeoutPolicy](https://orkes.io/content/error-handling#workflow-timeouts) | The policy for handling workflow timeout. Supported values:<ul><li>**TIME_OUT_WF**-The workflow is set to TIMED_OUT and is terminated.</li><li>**ALERT_ONLY**-Increments the counter to check the workflow status when it times out and logs relevant messages.</li></ul> | string | Optional. |
| [rateLimitConfig](https://orkes.io/content/error-handling#workflow-rate-limits) | A map of the workflow rate limit configuration. | object | Optional. |
| rateLimitConfig. **rateLimitKey** | A unique identifier to group workflow executions for rate limiting.<br/>Can be a fixed value (for example, "max") or a dynamic variable from the workflow input (for example, `${workflow.input.correlationId}`). | string | Optional. |
| rateLimitConfig. **concurrentExecLimit** | The number of workflow executions that can run concurrently for a given key. | integer | Optional. |
Expand Down

0 comments on commit 7a130f7

Please sign in to comment.