How does camunda persist variables between activities

Does camunda persist the data between activities in the cache?
Or does it query the database for the variables against that process instance Id whenever it starts a new activity?

See https://docs.camunda.org/manual/7.10/user-guide/process-engine/transactions-in-processes/.

Hi
Have gone through the link given.
But it doesnt mention when it updates the variables/data in the activity to the database or how the next activity gets the variables from the previous one

Hi @Anirudh,

the engine keeps all changed data in the cache until a transaction boundary is reached, e.g. by an asynchronous continuation mark or a wait state. It then commits the data to the database.
Before the commit, data is retrieved from the cache if it is present there. Otherwise the database is queried.

So, as it often is the case, it depends. :slight_smile:

Best,
Tobias

2 Likes