Transaction timeout on long running tasks fails before lockTimeInMillis

Hi @Jens_Stahl
It is good for such long tasks not to block engine threads unnecessarily. So I would really recommend you to do that with external tasks. If it helps your architecture, you could also think about a send/receive pattern. You could model this with a ServicesTask and a ReceiveTask. This can be helpful if you use e.g. an event broker like Kafka.

AsyncBefore does not help you. This controls a different behavior of the engine.
The engine works in transactions. From wait state to wait state. By default, not every element is a transaction. Some elements have transaction points by default (Message, UserTask, Timer, Conditional, …) All elements the engine has to “wait” for something.

For example, if 10 ServiceTasks are connected in series, the engine processes all tasks in one transaction because it does not have to wait for something (this does not count for external tasks). This means if the last one fails, it has to start from the beginning. With AsyncBefore / After you can control the wait states manually. There are also some best practices → Camunda Best Practices I would highly recommend you to read :slight_smile:
Transactions in Processes | docs.camunda.org

1 Like