# Job Retry cycles

{% hint style="success" %}
Available since Valtimo 13.7.0.
{% endhint %}

Jobs can fail for different reasons, for example when external services fail. Retry strategies provide resilience against temporary outages and help avoid incidents. Valtimo includes intelligent retry strategies with sensible defaults, which can be selectively overridden through configuration.

### Available retry cycles

The following retry cycles are available and can be applied to [specific BPMN-elements](https://docs.operaton.org/docs/documentation/user-guide/process-engine/the-job-executor/#retry-time-cycle-configuration).

| Name     | Cycle                            | Expression used in BPMN            |
| -------- | -------------------------------- | ---------------------------------- |
| DEFAULT  | `R3/PT1M,PT30M,PT2H`             | `${retryCycleProvider.default()}`  |
| QUICK    | `R3/PT30S,PT2M,PT10M`            | `${retryCycleProvider.quick()}`    |
| CRITICAL | `R5/PT1M,PT15M,PT4H,PT24H,PT48H` | `${retryCycleProvider.critical()}` |

### Overriding and custom cycles

These retry cycles can be overridden in application.yml. Furthermore, custom cycles can be added using the Spring Boot config files. Adjust the property `valtimo.process.jobs.retry.cycles` in `application.yml`.

```yml
valtimo:
    process:
        jobs:
            retry:
                cycles:
                    critical: R3/PT1M,PT15M,PT1H
                    default: R4/PT10S,PT1M,PT5M,PT15M
                    custom: R5/PT10S,PT1M,PT5M,PT15M,PT2H
```

## How to use

Retry cycles are available in expressions referencing the `retryCycleProvider` bean. See the following example:

![retry cycle usage](/files/3BqfOSQ3SHagapYwDnnF)

Custom cycles can be used by referencing them by using this expression: `${retryCycleProvider.custom("my-custom-cycle")}`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.valtimo.nl/features/process/retry-cycle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
