# Call Activity but only if process instance is not running

**URL:** <https://forum.camunda.io/t/call-activity-but-only-if-process-instance-is-not-running/21820>\
**Category:** Discussion & Questions\
**Created:** [August 10, 2020, 1:20pm UTC](https://forum.camunda.io/t/call-activity-but-only-if-process-instance-is-not-running/21820 "2020-08-10T13:20:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ItsPatrick](https://forum.camunda.io/user_avatar/forum.camunda.io/itspatrick/32/9210_2.png) [@ItsPatrick](https://forum.camunda.io/u/ItsPatrick)\
**Post date:** [August 10, 2020, 1:20pm UTC](https://forum.camunda.io/t/call-activity-but-only-if-process-instance-is-not-running/21820/1 "2020-08-10T13:20:03Z")

</div>

Hi

Is there possibility to check if there is running process instance via script task?  
I want to start 50+ processes that first one should start process X and rest of them only send a message with variables to that process.  
I’m not used to use scripts like ex. execution.getProcessEngineServices()… is the possibility to check if process X or process with specific business Key is running.  
I’ll be soo happy if somebody would share with solution to my problem.

 ![2020Modeler](https://forum.camunda.io/uploads/default/original/2X/b/b6fe462755e38cabaaaa2ae8a447150e0161a857.png)

---

<div class="post-metadata">

**Author:** ![Niall](https://forum.camunda.io/user_avatar/forum.camunda.io/niall/32/15333_2.png) [@Niall](https://forum.camunda.io/u/Niall)\
**Post date:** [August 10, 2020, 1:32pm UTC](https://forum.camunda.io/t/call-activity-but-only-if-process-instance-is-not-running/21820/2 "2020-08-10T13:32:36Z")

</div>

Hi @ItsPatrick welcome to the community.

What you’ve modeled probably wont work because even after the the one process has finished it will then move the sent event where it will try to send a message to a process that has ended.

Instead i would consider you take a look at this example - it’s not 100% what you need but you can re-use most of it to do what you want.

> **[NPDeehan/idempotent-process-example](https://github.com/NPDeehan/idempotent-process-example)**
>
> How to build a Camunda process that will only start one instance per request. - NPDeehan/idempotent-process-example

---

<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, 12:34pm UTC](https://forum.camunda.io/t/call-activity-but-only-if-process-instance-is-not-running/21820/3 "2024-01-30T12:34:16Z")

</div>

Closed on January 30, 2024, 12:34pm UTC


