# Handle failures for triggerable java service tasks

**URL:** <https://forum.flowable.org/t/handle-failures-for-triggerable-java-service-tasks/8877>\
**Category:** Flowable Engine\
**Created:** [January 15, 2022, 3:34pm UTC](https://forum.flowable.org/t/handle-failures-for-triggerable-java-service-tasks/8877 "2022-01-15T15:34:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnithinkk](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mnithinkk](https://forum.flowable.org/u/mnithinkk)\
**Post date:** [January 15, 2022, 3:34pm UTC](https://forum.flowable.org/t/handle-failures-for-triggerable-java-service-tasks/8877/1 "2022-01-15T15:34:45Z")

</div>

I’m not sure how to handle retries when it comes to handling failures for triggerable service tasks.

Let’s take a simple bpmn where it follows startEvent → serviceTask (async = true and triggerable = true) → endEvent

serviceTask (our custom JavaDelegate) makes rest calls to another service (let’s call serviceB) and goes to a wait state. Then serviceB will make callback to our flowable service with either SUCCESS/FAILURE callback. In case of SUCCESS callback, I can trigger and complete the task.

requirement: In case of failure callback, how do I ensure to retry the JavaDelegate.execute() method again? because the control of the flowable is in wait state of serviceTask now.

Our use case is to retry above requirement 3 times. After 3 retries move the execution to deadletter. When trying to bring back the execution from deadletter, again it should start from JavaDelegate.execute().

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [January 24, 2022, 3:45pm UTC](https://forum.flowable.org/t/handle-failures-for-triggerable-java-service-tasks/8877/2 "2022-01-24T15:45:58Z")

</div>

See my answer on [Handles failures for triggerable java service tasks - #3 by joram](https://forum.flowable.org/t/handles-failures-for-triggerable-java-service-tasks/8855/3)
