Query List of active/incident workflow instances

Hi!
What would be the recommended way of retrieving a list of all active(and/or with incidents) workflow instances?

We are using the provided docker-compose Zeebe + ElastcSearch.

If the recommended way would be through ElasticSearch, could you please provide a query?

Thank you!

Hi @ELopes, welcome to the Zeebe Community!

You can do it with Elastic Search (ES), but I don’t know how to query it. Someone else may have that at their fingertips.

There is Node package for Zeebe that queries ES: https://github.com/VilledeMontreal/workit/tree/master/packages/zeebe-elasticsearch-client.

You can use an exporter and listen to the events that signal the creation and completion of workflow instances. Then you maintain that in a state store outside Zeebe. This is how Simple Monitor (SM) does it.

I don’t have time to do this for you right now, but here is how I would approach this:

  • Read the Simple Monitor source to see what workflow event records listens to in order to get the current state.
  • Look at the Elastic Search exporter source to see how it constructs the exported representation of the workflow event records.
  • Either: use a similar approach to SM with the Hazelcast exporter; or write a query over Elastic Search that effectively streams the workflow events and allows you to build the current state.

Josh

3 Likes

Also, keep an eye on this: https://github.com/zeebe-io/zeeqs

2 Likes

hello ,how to listen to the events that signal the creation and completion of workflow instances

Exporters are the only way.