Get used flow nodes from the processEngine


im trying to build a process that reports the total used flow nodes and is supposed to run in each shared engine to report that into a timeseries database.
Does someone know how i can access the number of used flow nodes from within my process?

Best regards

I think i found it, is this the correct query? I want to use this to visualize it in a graph, but also for automated license usage reporting for camunda ee later on.

Long totalFlowNodeInstances = execution.getProcessEngine().getManagementService().createMetricsQuery()

NVM, i just found this confirming it:

Flow node instances is the sum of the metric activity-instance-start , documented here: , i.e. it counts whenever a BPMN or CMMN activity is started.