# Asynchronous JavaDelegate

**URL:** <https://forum.flowable.org/t/asynchronous-javadelegate/5553>\
**Category:** Flowable Engine\
**Created:** [March 3, 2020, 8:42pm UTC](https://forum.flowable.org/t/asynchronous-javadelegate/5553 "2020-03-03T20:42:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VladimirKhil](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/vladimirkhil/32/1655_2.png) [@VladimirKhil](https://forum.flowable.org/u/VladimirKhil)\
**Post date:** [March 3, 2020, 8:42pm UTC](https://forum.flowable.org/t/asynchronous-javadelegate/5553/1 "2020-03-03T20:42:27Z")

</div>

Hello!

Is there a way to make JavaDelegate.execute() method asynchronous? We have a custom HTTP call inside it and it seems to me that under heavy pressure of processes all Flowable threads become busy because of waiting for HTTP responses. And this behavior slows down Flowable performance.

No, we do not want to use HttpTask because we have custom logic.

Maybe I am doing the wrong thing and the best solution is to increase the number of task execution threads (how to do this - found answer: spring.task.execution.pool.coreSize)?

Thank you!

---

<div class="post-metadata">

**Author:** ![valentin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/valentin/32/3367_2.png) [@valentin](https://forum.flowable.org/u/valentin)\
**Post date:** [March 4, 2020, 1:27am UTC](https://forum.flowable.org/t/asynchronous-javadelegate/5553/2 "2020-03-04T01:27:01Z")

</div>

Hi Vladimir,  
you can mark the service task as triggerable service task and implement the [TriggerableActivityBehavior](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delegate/TriggerableActivityBehavior.java). With that you can start in `execute()` something asynchronous and call `runtimeService.trigger(executionId)` as soon as you are done.

See also [https://flowable.com/open-source/docs/bpmn/ch07b-BPMN-Constructs/#triggerable](https://flowable.com/open-source/docs/bpmn/ch07b-BPMN-Constructs/#triggerable)

Valentin

---

<div class="post-metadata">

**Author:** ![VladimirKhil](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/vladimirkhil/32/1655_2.png) [@VladimirKhil](https://forum.flowable.org/u/VladimirKhil)\
**Post date:** [March 4, 2020, 7:59am UTC](https://forum.flowable.org/t/asynchronous-javadelegate/5553/3 "2020-03-04T07:59:52Z")

</div>

Thank you very much, Valentin!
