How to get the active User Task of a Process Instance

For my Simulations I am looking for the active UserTask of a Process Instance.

In Camunda 8, this seems to be hard to achieve.

The tasks Query of the Tasklist API only supports these fields:

type TaskQuery {
  state: TaskState
  assigned: Boolean
  assignee: String
  candidateGroup: String
  pageSize: Int
  taskDefinitionId: String
  searchAfter: [String!]
  searchAfterOrEqual: [String!]
  searchBefore: [String!]
  searchBeforeOrEqual: [String!]
}

I also tried the Flow node instance of the Operate API - turns out the id is different to the User Task Id of the Tasklist (by +1 difference :wink:)

Any Ideas?

2 Likes

+1, this is currently way too complicated to do.

We ended up having to do the same thing - retrieve the task from the Operate API and then increment the returned key by one which we then use to query the Tasklist API. Feels super “hacky”.

Edit: Incrementing with 1 is not reliable, sometimes the task ID will be the same as the returned key, other times it’s +2 etc…

Hi @Brynvald
I made a feature request, which is now in the backlog. So in the future this will be possible :partying_face:.

2 Likes