# Configuring Multitenant with flowable(6.6.0)

**URL:** <https://forum.flowable.org/t/configuring-multitenant-with-flowable-6-6-0/7138>\
**Category:** Flowable Engine\
**Created:** [November 27, 2020, 5:32am UTC](https://forum.flowable.org/t/configuring-multitenant-with-flowable-6-6-0/7138 "2020-11-27T05:32:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![balajisundarajan8](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@balajisundarajan8](https://forum.flowable.org/u/balajisundarajan8)\
**Post date:** [November 27, 2020, 5:32am UTC](https://forum.flowable.org/t/configuring-multitenant-with-flowable-6-6-0/7138/1 "2020-11-27T05:32:13Z")

</div>

How to configure Sharedschema&SharedEngine multitenant option either through property file or programmatically ?

Scenario 1 - Need to configure Mutli-tenant using same DB schema for all tenant-id

Scenario 2 - Need to configure Multi-tenant using different Schema for each tenant-id.

Note - If multi-tenant need to configured programmatically, where do we need to configure exactly ?

---

<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:** [December 4, 2020, 10:47pm UTC](https://forum.flowable.org/t/configuring-multitenant-with-flowable-6-6-0/7138/2 "2020-12-04T22:47:58Z")

</div>

Scenario 1 is the default engine, pass the tenantId whenever you deploy a definition or start an instance and use it further in queries.

For scenario 2: have a look here: [https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/test/java/org/flowable/engine/test/cfg/multitenant/MultiTenantProcessEngineTest.java#L75](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/test/java/org/flowable/engine/test/cfg/multitenant/MultiTenantProcessEngineTest.java#L75)

---

<div class="post-metadata">

**Author:** ![tannth](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@tannth](https://forum.flowable.org/u/tannth)\
**Post date:** [April 20, 2021, 12:55pm UTC](https://forum.flowable.org/t/configuring-multitenant-with-flowable-6-6-0/7138/3 "2021-04-20T12:55:14Z")

</div>

> [@joram](#):
>
> Scenario 1 is the default engine, pass the tenantId whenever you deploy a definition or start an instance and use it further in queries.

For Scenario 1: Has it impact to performance? Something like **ExecutorPerTenantAsyncExecutor**

---

<div class="post-metadata">

**Author:** ![mykeul](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mykeul](https://forum.flowable.org/u/mykeul)\
**Post date:** [September 30, 2021, 12:59pm UTC](https://forum.flowable.org/t/configuring-multitenant-with-flowable-6-6-0/7138/4 "2021-09-30T12:59:30Z")

</div>

Hi @joram  
I implemented this solution and I see we have to pass the tenantId both when deploying:

```auto
 repositoryService.createDeployment().addClasspathResource("pipelineFoo.bpmn20.xml")
                    .tenantId("Foo").deploy();

```

and when starting an instance:

```auto
runtimeService.createProcessInstanceBuilder()
.processDefinitionKey("pipelineFoo")
                .tenantId("Foo");

```

Is this correct?  
I thought that if we deploy a definition along with a specific tenantId, we could start a process instance without re-specifying the tenantId  
What would be the advantage of passing the tenantId when deploying if we pass it when starting the process instance?

Cheers
