Disable historic variable modification

Hi, I am transferring big in memory variable (base64 encoded file) between activities in my execution process engine.
My issue is that after the process finished to run there is some historic update on this variable and it’s throwing an exception because this String is too big.
I have tried to remove the variable or to set the variable again to shorter value but the update from before still occurring.

Is there a way to disable this historic update?

Thanks for the help.

You have several options to avoid storage of historic process variables.

Simpliest is possibly to modify the engines history level https://docs.camunda.org/manual/7.16/user-guide/process-engine/history/#choose-a-history-level, so historic variables are never generated at all.

A more fine grained way is to mark spefic variables as “transient” so in general historic variables are stored, but certain variables are not. This might require changing code, depending on how you work with the API. Process Variables | docs.camunda.org

A solution could be to store the base64 string not as a variable of type string but as a java object with (for example) single field of type string. Objects are stored differently in camunda. They are stored as blobs which does not impose the max. length boundary as it does for string variables.