How to get a list of process instances via Java client in Camunda 8?

The documentation in https://docs.camunda.io/docs/apis-clients/overview/ mentions that the client APIs allow to “Start and cancel process instances”. I struggle to find a way to list all processes using the Java API. Any hints?

Hey @Manuel_Baumann

with the Clients, you can’t get this type of information. What you would normally do is to have an exporter deployed along with your Zeebe system/cluster and export the needed information into an external system, e.g. to elasticsearch and from that you can retrieve such information. You can then for example use Applications provided by Camunda, like Operate/Optimize.

You can take a look at the architecture page for more details Architecture | Camunda Platform 8

Hope that helps.

Greets
Chris

1 Like

In addition to the comment above, Operate provides a REST API to query data like process instances. Read more about it here: Operate API (REST) | Camunda Platform 8

2 Likes

Many thanks for the feedbacks. I followed @Philipp_Ossler 's approach for now. Just from a customer perspective, I’d expect this functionality in the client.

@Philipp_Ossler @Zelldon

Hi Phillip and Zelldon,

I’ve used Camunda 8 Self-Managed + Free approach i.e. open source part of Camunda 8:

That means on production I cannot use operate API to query Camunda processes,
the only way I can query Camunda is by calling Elastic Search directly:

Do you have some documentation, advice, examples how to start writing query to elastic search?

Hi @Jovan_Zoric,

I don’t know any examples about querying the exported documents, but here you can find more details about them (From the exporter point of view): zeebe/exporters/elasticsearch-exporter at main · camunda/zeebe · GitHub

Hope this helps, Ingo

1 Like