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: flowable-engine/ at main · flowable/flowable-engine · GitHub

What query have you tried that doesn’t work?