# External Job completion for a suspended instance

**URL:** <https://forum.flowable.org/t/external-job-completion-for-a-suspended-instance/7647>\
**Category:** Flowable Engine\
**Created:** [March 26, 2021, 1:52am UTC](https://forum.flowable.org/t/external-job-completion-for-a-suspended-instance/7647 "2021-03-26T01:52:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![psevestre](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/psevestre/32/373_2.png) [@psevestre](https://forum.flowable.org/u/psevestre)\
**Post date:** [March 26, 2021, 1:52am UTC](https://forum.flowable.org/t/external-job-completion-for-a-suspended-instance/7647/1 "2021-03-26T01:52:09Z")

</div>

Hi,

I’m trying to use an External Jobs to implement some long-running tasks in my application. This works fine for an active process instance but, if I suspend an instance while the external job is running, I’m not able to signal its completion using ExternalWorkerCompletionBuilder.complete(). The main reason, it seems, is that suspend() also removes the external job entry from its table.

I’ve tried to postpone the job completion by saving the completion task in an ad-hoc task and listening to a “resume” event. However, this also didn’t work: activateProcessInstanceById() recreates the external job entry but this entry is now unlocked so I can’t complete it.

Is there a way to reacquire he lock for a particular external job so I can complete it ?

PS: There seems to be a related question in the forum for a similar situation related to sending signals to a suspended instance, but it never got an answer, so I’m creating this new topic.

Flowable details: 6.6.0, MS-SQL DB.

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [March 29, 2021, 8:57am UTC](https://forum.flowable.org/t/external-job-completion-for-a-suspended-instance/7647/2 "2021-03-29T08:57:38Z")

</div>

Hey @psevestre,

> [@psevestre](#):
>
> Is there a way to reacquire he lock for a particular external job so I can complete it ?

Currently there is no way to reacquire an External Job. Or at least no way with a public API. Have a look at [`AcquireExternalWorkerJobsCmd`](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/cmd/AcquireExternalWorkerJobsCmd.java) to see how it is been done currently.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![psevestre](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/psevestre/32/373_2.png) [@psevestre](https://forum.flowable.org/u/psevestre)\
**Post date:** [March 29, 2021, 2:28pm UTC](https://forum.flowable.org/t/external-job-completion-for-a-suspended-instance/7647/3 "2021-03-29T14:28:29Z")

</div>

Hi, Filip.

Thanks for the answer. I’ll take a look and see if I can create a custom command for that;

Regards,  
Philippe
