GraphQl query tasks of only a process definition

I want to get the unassigned tasks of all process instances of a process definition.
The graphql query TaskQuery does not have a ProcessName nor a ProcessDefinitionId field to query only the tasks of a process definition. So, I am forced to iterate on returned Task objects to filter what I am interested for. I think this is an over-fetching.

Anyone has another idea to query the tasks of a proces definition? Am I missing something?

Regards,
Valentin

Hello @valiu ,

instead of fetching all and iterate these tasks, you could iterate task definition ids from the process model and query them.

You can find the bpmn xml in the Operate API.

I hope this helps

Jonathan

In Camunda 7 I used this REST API endpoint: Get Tasks | docs.camunda.org

with two query parameters, for example:
processDefinitionName - Restrict to tasks that belong to a process definition with the given name.
active - Only include active tasks. Value may only be true , as false is the default behavior.

So, one request and I get what I need without further treatments.

Your solution I don’t think is feasible: first get all task definition ids of a process definition, then iterate over and query them.

Regards,
Valentin

Hello @valiu ,

sorry I cannot help more than this. The proposed workaround can prevent overfetching.

We are aware that the TaskQuery is not complete yet and cannot be compared to the rest api endpoint you propose.

As a customer or a prospect, you can file a feature request yourself at any time.

Anyway, I will take this feedback and forward it myself.

Jonathan