Retries and individual steps for a process

Hello,
I am new to Camunda. Got a question: when I build a process with multiple steps - can I define a whole process as a transaction for “retry” purposes (if a step fails in the underlying database) or does each step constitute a transaction?
Thank you!

Hi @AlexCR

In general, a process is executed inside a single transaction UNTIL it reaches a wait state. At that point the transaction will be committed to DB.

So a process without any wait states would execute inside a single transaction. If a step in the process fails, the entire process (transaction) will be rolled back)

If an unhandled error occurs in a process with wait states, the transaction will be rolled back to the last wait state.

Wait states are fx user tasks, external tasks etc, but you can also manually add wait states by marking an activity as Asynchronous.

Hope that helps.

BR
Michael

If all the tasks(activities) in your process are service tasks and no wait states (usertask, message event and external task are natural wait state, and any activity if marked as async are explicit wait states) then you can execute all of them in single transaction but keep timeouts with your load balancer and database connection timeout in mind.

It is best to break the model into multiple transactions to avoid any timeout errors or to handle errors better within process model.