BPMN jobs: Overriding no' of retries and default retry wait time via application.yaml


I want to be able to override the default values for number of retries and retry wait time for BPMN jobs. As I understand it, the default values for the same are defined here:

I also understand that there is an exponential back-off every time before a retry.
Although the values seem to be hard coded to me, I also see that it they are configurable as per this doc: https://github.com/flowable/flowable-engine/blob/main/modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json#L602C29-L602C29

Another thing I found is that these values can be overridden at the serviceTask level: BPMN 2.0 Constructs ยท Flowable Open Source Documentation
But on Flowable design, I did not see a way to override them for a serviceTask or a processTask.

Basically I want to override them at the Flowable engine level, and would also like to know how I can override them at process definition level via Flowable engine. We use Flowable engine, and do not edit the XML files ourselves.

Looking forward to hear from you!

Hi @sagar-kalburgi-ripco,

you can use the method ProcessEngineConfigurationImpl#setAsyncExecutorNumberOfRetries.

In the Flowable Cloud Design you can change it on a service task level below the advanced option as part of the Failed Job Retry Time Cycle.


Hi @valentin
Thanks for the response. Even if I make use of ProcessEngineConfigurationImpl#setAsyncExecutorNumberOfRetries, if a job fails due to OptimisticLockException, the number of retries that I set will get overridden by the number of retries hardcoded on this class right? https://github.com/flowable/flowable-engine/blob/main/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/interceptor/RetryInterceptor.java#L29

And on Flowable design I checked and I do not see the advanced option to set the retry time on the configuration of service task.

Hi @sagar-kalburgi-ripco

Your service task must be set to asynchronous = true, then you see the retry option. Because the retry mechanism does only work for asynchronous tasks.