Tasklist page size max limit

Hi,
I am new to Camunda. Right now I am implementing a workflow with user tasks. I have an api endpoint to get all user tasks from Tasklist api.
Tasklist Api schema documentation says,

#Task query - query to get one page of tasks.
input TaskQuery {

State of the tasks

state: TaskState

Are the tasks assigned?

assigned: Boolean

Who is assigned to the tasks?

assignee: String

given group is in candidate groups list

candidateGroup: String
#Size of tasks page (default: 50).
pageSize: Int

Task definition ID - what’s the BPMN flow node?

taskDefinitionId: String
#Array of values copied from sortValues of one of the tasks, query will return page of tasks going directly after this values plus same sort values.
searchAfter: [String!]
#Array of values copied from sortValues of one of the tasks, query will return page of tasks going directly after this values.
searchAfterOrEqual: [String!]
#Array of values copied from sortValues of one of the tasks, query will return page of tasks going directly before this values plus same sort values.
searchBefore: [String!]
#Array of values copied from sortValues of one of the tasks, query will return page of tasks going directly before this values.
searchBeforeOrEqual: [String!]
}

Default page size is 50.

  1. What is tha max value for pageSize?
  2. Can I get all user tasks? If yes how to get all user tasks from Tasklist Api?

Hi @Goms,

It’s an int value, so maximum is Integer.MAX_VALUE

yes you can. But: What would you do if you see that you have one million user tasks to complete? It will take more than eleven years to complete all if you complete one task per second without sleep or rest. Or have you ever read all Google results from your queries?

Also, for performance and security reasons it’s a good advise to limit the results.

Have a look at the docs here and linked pages for configuration options:

Hope this helps, Ingo

@Goms It looks like you refer to the C8 Tasklist GraphQL API; do you ask for this API or the C7 one (which is REST)?

In C7, there is the Get Task Count | docs.camunda.org method, allowing you to get the total count of tasks. In C8, this is missing, but as @Ingo_Richtsmeier said, you could just provide the max integer.

Also, the API is designed in a way that you get the top count of tasks for your filters to show in your UI, so to work on the tasks top to bottom. Currently, there is no pagination support (i.e. if you want to build pagination in your UI or progressive loading). What is your use case for displaying all tasks at once?

I am using C8 which is a GaphQL API.
As you said I am going to show them in UI with pagination

@Goms you can build pagination the following way:

To request the next/previous page you need to use searchAfter / searchBefore or searchAfterOrEqual /searchBeforeOrEqual, and include the last/first task of the previous response.

We can’t return the total count of tasks, so the list of tasks will end as soon as this chain of requests will not longer return any task.

So to said, you can build infinite scrolling/progressive loading, but no full pagination

@christian-konrad I have also the same issue regarding task total count number. I tried to implement the request for next/previous page as you described and it worked ok with progressive loading. But it is essential I think to be able to show the total task count for each query, show it in the UI (with a badge for example) so that the user know the number of tasks that are not completed and assigned to him/her and load them progressively afterwords as you described. Is it possible in the near future the C8 also supports it as in C7 currently?