# How to create a process definition between two different tenantId

**URL:** <https://forum.flowable.org/t/how-to-create-a-process-definition-between-two-different-tenantid/9239>\
**Category:** Flowable Engine\
**Created:** [April 22, 2022, 2:53am UTC](https://forum.flowable.org/t/how-to-create-a-process-definition-between-two-different-tenantid/9239 "2022-04-22T02:53:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![senthacit](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/senthacit/32/2795_2.png) [@senthacit](https://forum.flowable.org/u/senthacit)\
**Post date:** [April 22, 2022, 2:53am UTC](https://forum.flowable.org/t/how-to-create-a-process-definition-between-two-different-tenantid/9239/1 "2022-04-22T02:53:25Z")

</div>

Example Use case

say there is a workflow(w1) for organisation1 whereIn one of the steps which has link to another workflow(w2) in organisation2 on completion of w2 then w1 should continue. W1 does not need to know all the steps in w2 and w2 need not know all steps in w1.

w1.task1 → w1.task2 → w1.task3. → w1.task4 ----\> tenantId 1  
|(dependency)  
|  
|  
|  
w2.task1-\> w2.task2 ----\> tenantId 2

Please let us know your suggestion and documents if any.  
Thanks

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [April 22, 2022, 10:23am UTC](https://forum.flowable.org/t/how-to-create-a-process-definition-between-two-different-tenantid/9239/2 "2022-04-22T10:23:30Z")

</div>

Hi senthacit,

There are several possibilities. As I understood you want to start another process for different tenant from currently running process.  
Possibilities:

1. user rest api to start the process for different tenant.
2. use java api (e.g. runtime service) and start the process with tenantId

Regards  
Martin

---

<div class="post-metadata">

**Author:** ![senthacit](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/senthacit/32/2795_2.png) [@senthacit](https://forum.flowable.org/u/senthacit)\
**Post date:** [April 23, 2022, 3:34am UTC](https://forum.flowable.org/t/how-to-create-a-process-definition-between-two-different-tenantid/9239/3 "2022-04-23T03:34:00Z")

</div>

> [@martin.grofcik](#):
>
> use java api (e.g. runtime service)

Hi Martin,

thanks for replying back! I want to understand how the bpmn xml file would like for such kind of use case. we as are always deploying 1 file for 1 tenant

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [April 24, 2022, 6:18pm UTC](https://forum.flowable.org/t/how-to-create-a-process-definition-between-two-different-tenantid/9239/4 "2022-04-24T18:18:15Z")

</div>

From `runtimeService`

```auto
    /**
     * Similar to {@link #startProcessInstanceByKey(String)}, but using a specific tenant identifier.
     */
    ProcessInstance startProcessInstanceByKeyAndTenantId(String processDefinitionKey, String tenantId);

```

the benefit of java api is (if you are using the same jvm) is sharing the transaction,

Regards  
Martin

---

<div class="post-metadata">

**Author:** ![senthacit](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/senthacit/32/2795_2.png) [@senthacit](https://forum.flowable.org/u/senthacit)\
**Post date:** [April 25, 2022, 2:23am UTC](https://forum.flowable.org/t/how-to-create-a-process-definition-between-two-different-tenantid/9239/5 "2022-04-25T02:23:38Z")

</div>

thanks for the response !
