Getting tasks by processVariables

I have a task that is split up into multiple paths by an exclusive gateway. Each path contains a sub process. In the start event of each sub pocess I added a listener for the start event of type script, javascript, inline script. the script is: execution.setVariableLocal(‘uuid’,‘’)

next step there is an externalTask that sets a variable uuid on completion. The variables seem to be scoped correctly to the subprocess.

Now in postman I do a call to: {{camunda-host}}engine-rest/task?processVariables=uuid_eq_0ab34035-6286-11e9-84a0-0242ac1c0002 (this is the uuid from one of the scopes) I expect one Task to show up, but all tasks show up in the result.

My whole idea was that I could select the task based on this uuid that I have in the variable and then complete it from the outside world, but now it just completes a random (probably the last) task…

How can I make sure I only get back the task that comes right after the externalTask I completed with the uuid ?