Does overwriting instance variable, prevent it from propagating through the workload?

Hi all,

I am using java client to instantiate instances with variables. At some point in my code I overwrite the instance variable like this:

client.newSetVariablesCommand(processedCount.getWorkflowInstanceKey())

                .variables(data)

                .send()

                .join();

On the zeebe monitor, I can see the variable data and when I examine the history for this variable, I can see all the different data files which were sent (i.e. I can see distinct data for the data variable in the history of the data variable).
However, in my workflow, only one particular instance has gone through the whole workflow. For example if in one of my workers I decide to log data, only one instance of the data variable is logged and not all the ones I can see in the data variable history.

This makes me think that every time I use the above java command, not only the instance variable I sent as the data variable is overwritten, but it also does not go through the workflow? Is that an accurate understanding?

I was thinking that each instance of the data variable (i.e. all the ones I can see in the variable history) should have gone through the workflow at some point, but this does not seem to be the case.

Thanks you

Hi @Nima_Namjouyan :wave:

I’ve problems to understand your question. Please rephrase the question (using common terms) and provide an example that shows the behavior.

In a process instance, variables can be stored on different scopes. By default, the variables are stored on the root level of the process instance (except input mappings).

Your command updates the variables on the only root scope of the process instance.

The simple monitor collects all variable events to show the current value of a variable and all previous values. A job worker receives only the current value of a variable.