History of changes to business process instance variables (not local)

Hi all!
I use historyService to get the history of variable changes in a business process instance like this:

historyService.createHistoricDetailQuery()
                 .variableUpdates()
                 .processInstanceId(processInstanceId)
                 .orderByTime().asc()
                 .list();

As a result, I get a list of all changes, where in some instances of HistoricDetailVariableInstanceUpdateEntity I see:
activityInstanceId=2d5d4d14-b9c1-11ee-bed2-c684b710a2ce
and in some like this:
activityInstanceId=Activity_1jc173e:2d645203-b9c1-11ee-bed2-c684b710a2ce
does this mean that the first case is a change in a process variable, and the second is the internal area of the step (local)?
If this is the case, how can I understand from the history at what step (id) the business process instance variable (not local) was changed?
variableUpdates() does not affect the result of the request…
camunda ver 7.20.0

I believe that this is the case when the length of the activity BPMN ID and Instance GUID are longer than the column length. In those cases, only the Instance GUID will be recorded. If your InstanceID contains a : then it will represent both the BPMN ID and the Instance GUID. If it doesn’t, then it is only showing the Instance GUID.

I checked, this is not the case (the length of the Activity identifier has no effect.
And I still can’t understand the answer to this question:
“If this is the case, how can I understand from the history at what step (id) the business process instance variable (not local) was changed?”

Hi @Oliver1,

I believe that if processInstanceId = executionId then it means the returned variable instance is a process instance scoped variable

Excellent thank you!
It remains to understand at what step the variable changed…