Process history not visible after an exception occurs

When my process fails because of an exception, for example in a script task where SPIN cannot access a property in a variable containing JSON (a legitimate error), I get the error logged in the wildfly log however there is no record within the cockpit that the job ever even started. I’m invoking the process via the Camunda REST API and I get an Internal Server Error message back. I’m fairly new to writing processes so maybe every process should have some kind of exception handling task and I simply don’t know how to do it. It just seems very odd that there should be no trace of the process instance ever existing after at least some of the activities have completed.

Hi @marshall.burns,

That is due to the engine’s transactional behavior. When an exception occurs during process instantiation (e.g. due to a script task failing that is executed synchronously), the active transaction rolls back, including all runtime and history events. In effect, the instantiation is unsuccessful, so the engine write to the database.

Read our documentation about transactions in the engine here: https://docs.camunda.org/manual/7.5/user-guide/process-engine/transactions-in-processes/. It describes how you can define transaction boundaries, so that you can control to which points in the process the process engine rolls back.

Cheers,
Thorben

Major thanks for the explanation, this will be very helpful!