Retrieve Process variable, not Task variable

I have a case where I want to retrieve all of the variable instances from the Process variables and not the Task variables in cases where the same variable name exists at the process level and the local Task level. I am using the rest call Camunda Platform REST API but can’t see a way to isolate the process vs task variables. Any ideas?

Hi @Bill_Powell,

Simply pass a value for processInstanceIdIn in the request body of the REST call.

...
"processInstanceIdIn": ["aProcessInstanceId"]
...

This way only variable instances belong to aProcessInstanceId will be retrieved.

Thanks @hassang. I am searching for a variable instance within all of the active process instances. I suppose I could create a very long list of process instances, but other than that it seems my only other option is to remove the task variables from the result set.