# Dealing with failure of asynchronous service tasks invocation

**URL:** <https://forum.camunda.io/t/dealing-with-failure-of-asynchronous-service-tasks-invocation/6252>\
**Category:** Discussion & Questions\
**Tags:** process-engine\
**Created:** [February 20, 2018, 6:12pm UTC](https://forum.camunda.io/t/dealing-with-failure-of-asynchronous-service-tasks-invocation/6252 "2018-02-20T18:12:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cristian](https://forum.camunda.io/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@Cristian](https://forum.camunda.io/u/Cristian)\
**Post date:** [February 20, 2018, 6:12pm UTC](https://forum.camunda.io/t/dealing-with-failure-of-asynchronous-service-tasks-invocation/6252/1 "2018-02-20T18:12:09Z")

</div>

In our company we don’t use Camunda Cockpit, we display all information related to Camunda and everything else in our own application’s UI. When an asynchronous service task invocation fails as part of a process instance execution, similarly to Camunda Cockpit, we want to show in our own application that there was an incident and be able to retry execution after having dealt with the cause of issue. One approach would be to follow the suggestions coming from here:

[https://blog.camunda.com/post/2013/11/bpmn-service-synchronous-asynchronous/](https://blog.camunda.com/post/2013/11/bpmn-service-synchronous-asynchronous/)

and from here

> **[camunda/camunda-bpm-examples](https://github.com/camunda/camunda-bpm-examples/tree/master/servicetask/service-invocation-asynchronous)**
>
> camunda-bpm-examples - A collection of usage examples for camunda BPM intended to get you started quickly

by subclassing AbstractBpmnActivityBehavior class, use our own queue for storing intended invocations, executing them asynchronously and updating the queue to reflect whether invocation was successful or not and also have the ability to retry on failure.

Another approach would be to use the newer Camunda capabilities by resorting to Async Before/After properties of Service Tasks which were not available some time ago. However, if we use this approach, when we display information about whether service invocations succeeded or failed and be able to retry, we will need to use some Camunda API for detecting whether service task invocation failed or not, as well as for retrying. Where are these documented, please?

Any suggestions, please?

Thank you,

Cristian

---

<div class="post-metadata">

**Author:** ![sdorokhova](https://forum.camunda.io/user_avatar/forum.camunda.io/sdorokhova/32/21459_2.png) [@sdorokhova](https://forum.camunda.io/u/sdorokhova)\
**Post date:** [February 21, 2018, 8:35am UTC](https://forum.camunda.io/t/dealing-with-failure-of-asynchronous-service-tasks-invocation/6252/2 "2018-02-21T08:35:09Z")

</div>

Hi Cristian,

take a look at these REST endpoints:

[GET /incident](https://docs.camunda.org/manual/7.8/reference/rest/incident/get-query/) - you can provide `processInstanceId` and/or `activityId` to find the incidents, related with specific process instance or activity.  
[GET /job](https://docs.camunda.org/manual/7.8/reference/rest/job/get-query/) - the same filters as in query above, you can find the job(s) related with specific service task  
[PUT /job/{id}/retries](https://docs.camunda.org/manual/7.8/reference/rest/job/put-set-job-retries/) - calling this you can retry the job after resolving the incident cause -\> the incident will be resolved/deleted and job will be retried

Does this help you?

---

<div class="post-metadata">

**Author:** ![Cristian](https://forum.camunda.io/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@Cristian](https://forum.camunda.io/u/Cristian)\
**Post date:** [February 21, 2018, 4:51pm UTC](https://forum.camunda.io/t/dealing-with-failure-of-asynchronous-service-tasks-invocation/6252/3 "2018-02-21T16:51:06Z")

</div>

Hi Svetlana,

Yes, it does help me. Thank you!

Cristian

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [January 30, 2024, 11:07am UTC](https://forum.camunda.io/t/dealing-with-failure-of-asynchronous-service-tasks-invocation/6252/4 "2024-01-30T11:07:27Z")

</div>

Closed on January 30, 2024, 11:07am UTC


