Na variables in query endpoints but in historic-variable-instances endpoint

If i use an endpoint of the flowable rest api like flowable-rest/service/query/historic-process-instances or service/history/historic-process-instances/[id] i got a response with an empty variable list.

But if a use the endpoint service/query/historic-variable-instances and put my process instance id in there, i got my bunch of variables, which are defined in the process.

Why did the first endpoints don’t send me my variables back?

Hey @MeAndMyTeam,

you can use the parameter includeProcessVariables=true that should return you the list of variables (names and values).
The variables are not included by default, because the endpoints are using the ProcessInstanceQuery to retrieve the data. See this code. Those endpoints query process instances and you need to include the parameter if you want the variables. If you query for thousands of instances and all of them have hundreds of variables, that can impact the performance.

Calling the service/query/historic-variable-instances endpoint will create a variable instance query with the provided id as parameter. That is not the same as a query for process instances.

Greetings

Christopher

Thank you @WelschChristopher now i see the parameterincludeProcessVariablesin the /query/historic-process-instances endpoint in the swagger doku.

On the /history/historic-process-instances/{processInstanceId} endpoint it is not possible, but one can use the /history/historic-process-instances endpoint and set processInstanceId and the includeProcessVariables as parameters.

@MeAndMyTeam,

you are correct, that is currently not possible for fetching single instances. If that is something you need, feel free to contribute and add it. We are always happy about contributions :slight_smile:

Greetings

Christopher