# How to Suspend A Process Instance using Service Task

**URL:** <https://forum.flowable.org/t/how-to-suspend-a-process-instance-using-service-task/6082>\
**Category:** Flowable Engine\
**Created:** [May 25, 2020, 2:50pm UTC](https://forum.flowable.org/t/how-to-suspend-a-process-instance-using-service-task/6082 "2020-05-25T14:50:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MAGICBEANSS](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/magicbeanss/32/1926_2.png) [@MAGICBEANSS](https://forum.flowable.org/u/MAGICBEANSS)\
**Post date:** [May 25, 2020, 2:50pm UTC](https://forum.flowable.org/t/how-to-suspend-a-process-instance-using-service-task/6082/1 "2020-05-25T14:50:39Z")

</div>

How to Suspend A Process Instance using Service Task.  
withing service task I have the following code

```
RuntimeService runtimeService = Context.getProcessEngineConfiguration().getRuntimeService();
log.info("Suspending {}",execution.getProcessInstanceId());
runtimeService.suspendProcessInstanceById(execution.getProcessInstanceId());

```

But the process seems to be continuing , as usual even after execution of the Service Task .  
I am expecting the process should suspend at the service task itself.

How can I achieve that.

---

<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:** [May 26, 2020, 8:37pm UTC](https://forum.flowable.org/t/how-to-suspend-a-process-instance-using-service-task/6082/2 "2020-05-26T20:37:15Z")

</div>

No, that won’t work. The suspension is only checked when calling API’s (e.g. taskService#completeTask), not when the process instance is in the middle of executing. If you want to implement that, you’ll need to make your delegate a wait state (by implementing the ActivityBehavior, calling the suspend method and not leaving the service task).

---

<div class="post-metadata">

**Author:** ![deve](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@deve](https://forum.flowable.org/u/deve)\
**Post date:** [June 10, 2025, 4:20pm UTC](https://forum.flowable.org/t/how-to-suspend-a-process-instance-using-service-task/6082/3 "2025-06-10T16:20:48Z")

</div>

Do we have rest api to suspend process instance?

Thanks
