Rollback Exception Behavior

Hi all,
I know that a rollback to the last wait state is done when there is an unhandled error, and that everything that has been done is rolled back.
But my question is the following:
Is it possible to leave the behavior unchanged, then roll back the transaction returning an error upon completion of a task, but at the same time save information inside a variable?

For example, let’s consider the case where I have a human task A, and two service tasks B and C.
I want that if B or C fails, the flow returns to task A with an error, but at the same time write some information, such as knowing if service task B was completely executed?
In the normal behavior these writes are rolled back.

Hello @FurioShow ,

what would speak against adding transaction boundaries (async before) on service task B and C? This would prevent you from losing progress.

Jonathan

I had already thought about it, but doing so I wouldn’t have an exception in case of an error.
I should intercept the incidents created, and that’s not the goal.

Hello @FurioShow ,

you will have an error which is saved to the engine database as incident and can be inspected from the cockpit.

The reason is that usually, you want a user task to be completed regardless of what is happening afterwards. If there is an error afterwards, it can be taken care of in the cockpit by someone else than the business user.

How does your use case differ from this?

Jonathan