Error attempting to set process instance variable via REST API

While attempting to set a process instance variable via the REST API we are getting an error. We’re using the following API endpoint:

PUT /process-instance/{id}/variables/{varName}

The error we are receiving is:

Cannot put process instance variable {varName}: execution undefined doesn’t exist: execution is null

Clearly there’s something we’re not understanding here. Can anyone point us in the right direction?

It might be relevant to note that if we use the task API, we are able to set the variable:

PUT /task/{id}/variables/{varName}

and then when we examine the process instance in the Cockpit, the variable name and value are listed.

Hi @kilsen,

The error message suggests that the provided process instance id does not identify a running process instance. Can you double-check that?

Cheers,
Thorben

Thanks for replying.

The process instance is definitely running. I just tried it again and got a slightly different message:

Cannot put process instance variable assignee: execution 26043775-583d-11e8-9a0a-a08869facb26 doesn’t exist: execution is null

(fyi, “assignee” is the name of the variable that we are attempting to set)

Can you please share your Camunda version, the process model and the exact steps to reproduce the problem?

Thanks,
Thorben

Unfortunately we can’t really share it. But we were able to use the task-based endpoint to set the variable, and it actually sets a process-instance variable when we do that.

i am actually facing the same issue, if you have got the solution, please share it here.
thank you