So far we maintained for Activiti a JSON API-conform REST API that gave use quite a rich set of features. See http://www.crnk.io/releases/latest/documentation/#_activiti_module. Currently it is in consideration to also port it to Flowable. But in general we are rather limited by the Query API of flowable/activiti (
https://github.com/Activiti/Activiti/issues/2089). So we also consider accessing the underlying data directly, which in turn maybe also results in more effort. Maybe you also have some input here in the context of where flowable is heading.
Adding support for more query capabilities is always a good thing for anyone using the Flowable engine. You could indeed go directly to the lowest level to query just about anything in any way you want, but if we can add or collaborate around adding these capabilities to the high-level query API that’s of course the more preferred route.
Custom variable sorting is definitely interesting. The startTime is already added to the API, see https://github.com/flowable/flowable-engine/blob/5ee19e520ad6f18df65872aa23ef39886c8ff7cc/modules/flowable-engine/src/main/java/org/flowable/engine/runtime/ProcessInstanceQuery.java#L372. Do you have some examples of what’s currently missing on top of that?