How to set retry for all service tasks if the error code is in 4XX or 5XX series?

Hi all,

I’m using the service task for API integration where API response might throw an exception if API response exception/error code is in 4XX and 5XX series then I want to retry for certain times.

I found this and it’s working for all the API response series, but I want this for some specified series.

Can anyone tell me how to set retry for all service tasks if the error code is in 4XX or 5XX series?

Thank you in advance for your suggestions.

Best regards,
Vinit Kumar

The retry mechanism kicks in if the async job fails. And a job fails if an uncaught exception pops up. Hence you should write your code in such a way that only error codes 4xx und 5xx result in an exception propagated to the process engine; all other exceptions should be caught by your code and handled appropriately.