Custom task query to remote server

We’ve got flowable running in a docker container and would like to query tasks based on process variables. The current REST api won’t let us do that so we’re looking for different solutions. What would be the best way forward? Can we somehow plug into the remote server and create a processEngine instance (so we can retrieve a taskService object to perform our custom queries with)?

Looking into the code, it does allow that: https://github.com/flowable/flowable-engine/blob/main/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskBaseResource.java#L439

What query have you tried that doesn’t work?