Query zeebe for long running processes

Hi all,
Is there a Zeebe API that allows retrieving currently running process instances so they can be cleaned up, without relying on Operate or externally exported data? I’m looking for a way to get an internal snapshot of Zeebe’s running process states to manage memory usage effectively.

@deepCamunda , you can try something like this:

ProcessInstanceFilter processInstanceFilter = new ProcessInstanceFilterImpl();
processInstanceFilter.active(true);
processInstanceFilter.bpmnProcessId("myProcess");
processInstanceFilter.running(true);
SearchQueryResponse<ProcessInstance> searchQueryResponse =
                zeebeClient.newProcessInstanceQuery().filter(processInstanceFilter).send().join();
        
List<ProcessInstance> processInstances = searchQueryResponse.items();

Oh awesome. wasnt aware of these apis. Thanks

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.