Shared variables accessible to all process instances

Hi folks,

I’m looking for a solution to add some global variables which can be later shared and reused by different process instaces instead of passing variables In and Out Mapping in the BPMN files.


1 Like


Could you explain a little more about your use case - fx what kind of data needs to be available to all process instances?


I need to define a variable in a root process instance and access to its content in sub process instance without mapping it explicitily in the BMPN files.

In another word, I want to set it globally, I can’t find a solution with Camunda Java API that let me able to do this.

Hi @Amine_Safi,

Variables defined in process instance level are accessible from within all embedded scopes including sub-processes.

Below docs might be of help to you

Hi @Amine_Safi,

It would be great if you can share your model or a simplified version of it.

1 Like

This does not apply to processes started via a “call activity”. In that case, variabled must be passed explicitly.


Hi @fml2,

Exactly, this only applies to expanded sub-processes as call activities create new separate process instances of the called definitions so variables need to be passed explicitly in that case.

1 Like

If I understood correctly, it is not possible to use shared variables between a process and a sub-process and I need to pass them explicitly in the BPMN using In/Out mapping.

Hi @Amine_Safi,

This is true if you are using call activity

But if expanded sub-process is used then process instance variables are accessible from within the sub-process