Camunda - Variable to be used for multiple WF


I need to define some variables which should be available across any workflows. Currently, when I start the workflow then the variable is added every time in the REST payload… I require to define variables globally and access across running workflows. Is it possible to define global variables?

What do you mean by global variables?
Camunda uses the concept of variable scopes to provide certain levels of access for a given variable.
See here for a detailed description.

I guess you want to share variables across multiple process definitions and/or process instances. AFAIK you can use a hacky solution by passing variables via message correlation to a target process instance.

Thanks. Let me try message correlation.

I have added environment vairables to be accessed across all the workflows. Below is the code,

var system = java.lang.System;
var username = system.getenv(‘MY_ENV’);