External Task and local variables

Hello all,

Some parts of my processes are using external tasks, my external task workers are stateless and asynchronous proxy to some other legacy system, which has no way of storing external task id, therefore I wanted to store external identifier as local variable for external task. This sounds fine until I need to complete / fail external task, I have no way of fetching external task by their local variable value (similarly to what is done with user tasks).
This is my test process:

This is the communication schema I want to archive:

I have already tried providing custom rest API to fetch external tasks by local variables but It seems like ExternalTaskService does not provide any way of querying external tasks by their local variables, is there a way to archive this? Is there some reason why querying external tasks by local variables is not supported?

Maybe it is possible to extend the lock of your task with a new worker id which contains your legacy system job id:

Then you could query for exactly this task by its worker id when the legacy system callback arrives.