Get count of called process definitions using REST API

I have a requirement where i need to get the count of called process definitions. Is there a REST API for getting the count. I am aware we can get process instances via different parameters like lIke process definition key, parentProcessInstanceId but those are either very general or very specific.

Say, if I have a process in which there is a call activity. I need to get the count of call activity for the parent process.

Hi @mayank13,

If we are talking about only one process

You can check this REST API and more specific superProcessInstance parameter (Restrict query to all process instances that are sub process instances of the given process instance. Takes a process instance id.).

Does this help you?

Best regards,
Yana

No. There are multiple process instances of parent.

Parent process - P1. Contains call activity CA1.
P1 has multiple instances running. Some of the instances are waiting for CA1 to complete. Need the count of all CA1. Essentially the count which we see in cockpit.

Hi,

But if it is only CA1, you know the its processDefinitionId and can query by it, or?

Best regards,
Yana

CA1 could be generic process being used by muliple different processes so the count would be incorrect.

Hello @mayank13,

Ok, if you query by processDefinitionId: PA1pdId & activityIdIn: CA1activityId,
you will get the count of process instances which currently wait in a leaf activity with this activity id.
Did I get it this time? If not, could you please provide sample of your process (PA1 & CA1). This will help me to understand the scenario better.

Best regards,
Yana