How to increase limit from 20000 variables in REST API in activiti?

When making a REST API call to query historic tasks using the parameter “includeProcessVariables”: “true” , a maximum of 20,000 variables are returned. The results of the REST API when using “includeProcessVariables”: “true” are cut off as soon as the 20,000th variable is in the REST API response.

A customer have around 500 process variable in on process and for that he is only able to get the first 40 process Data with includeProcessVariables=true.

In docs , it is mentioned that the limit of 20000 is for performance reason. Can this limit be changed. I am thinking to increase the limit to 100000 or more.

Same issue here ,

I haven’t dug too deeply into this code, but my guess is that something like this would work:

    EngineConfigurationConfigurer<SpringProcessEngineConfiguration> processEngineConfigurationEngineConfigurationConfigurer(){
        return engineConfiguration -> {
            System.out.println("configuring Process Engine");

Edit, I just realized the subject says “in Activiti”, are you using Flowable or Activiti?

My bad, I am using flowable.

@wwitt is there a way I can filter only a few process variables while making this call? I am always interested in a few variables not all.


You’d need to craft some custom queries using the Java APIs, here are some examples from the documentation:

Hi! Is it possible to set those limits with spring properties (in or with environment variables)?

No, this property isn’t exposed. You’d need a simple EngineConfigurer bean to set it.

@joram what is the property ?

Hi @David_H

Which Flowable OSS version do you use?

This issue is fixed with v6.7.0 (see also Rework how we do paging and including data from other tables by filiphr · Pull Request #2892 · flowable/flowable-engine · GitHub)


We are using Flowable and we are getting the following exception:

logger_name: o.f.j.s.i.a.DefaultAsyncRunnableExecutionExceptionHandler
message: Job JOB-c5678d8d-5bcb-11ed-988d-0a580a822c9a failed
stack_trace: <#7f89484e> j.l.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.util.ArrayList.grow(Unknown Source)
at java.util.ArrayList.grow(Unknown Source)
at java.util.ArrayList.add(Unknown Source)
at java.util.ArrayList.add(Unknown Source)
at o.f.v.s.i.p.e.HistoricVariableInitializingList.add(
at o.f.v.s.i.p.e.HistoricVariableInitializingList.add(
at o.f.c.e.i.h.HistoricCaseInstanceQueryImpl.addCachedVariableForQueryById(
at o.f.c.e.i.h.HistoricCaseInstanceQueryImpl.executeList(
at o.f.c.e.i.q.AbstractQuery.executeSingleResult(
at o.f.c.e.i.q.AbstractQuery.execute(
at o.f.c.e.i.i.CmmnCommandInvoker.lambda$execute$0(
at o.f.c.e.i.i.CmmnCommandInvoker$$Lambda$1728/ Source)
at o.f.c.e.i.i.CmmnCommandInvoker.executeOperation(
at o.f.c.e.i.i.CmmnCommandInvoker.executeOperations(
at o.f.c.e.i.i.CmmnCommandInvoker.execute(
at o.f.c.e.i.i.TransactionContextInterceptor.execute(
at o.f.c.e.i.i.CommandContextInterceptor.execute(
at o.f.c.s.SpringTransactionInterceptor.execute(
at o.f.c.e.i.i.LogInterceptor.execute(
at c.f.c.m.i.i.MetricsCommandInterceptor.execute(
at o.f.c.e.i.c.CommandExecutorImpl.execute(
at o.f.c.e.i.c.CommandExecutorImpl.execute(
at o.f.c.e.i.q.AbstractQuery.singleResult(
at c.c.c.c.f.a.h.ProcessUtilsImpl.getHistoricCaseInstance(
at c.c.c.c.f.a.h.AuditModelBuilder.getPayload(

Hence I would like to limit the number of variables that the query returns.
Using a newer version of Flowable we don’t get any stack trace but we do run out of memory - I suspect it’s the same cause.

That shouldn’t happen with newer versions. How many variables are you requesting and what API call are you using ?