Use Case: In order to prepare a Camunda 8 migration, we moved our camunda 7 operation model to “external”, so we have our engine running on a separate node than our business logic. As long as we used DelegateExpression for the business logic integration (JavaDelegate making a REST call to the backend), we had no problems with a multiinstance service tasks iterating over a collection of ids, looking like this:
But when we went one step further and switched from JavaDelegate/REST to external task worker, we get a bunch of OptimisticLockingExceptions on the Execution- or VariableEntities.
My analysis: The C7 engine has known issues with “real” parallel execution. This is why the “exclusive” switch appears whenever I choose async-before.
But: The “execution is exclusive for a process instance” only applies to the jobExecutors. for two ids in my collection, the async continuation only runs one job at the time. So far so good. Because of the external task, each of these jobs ends when the external task instance is persisted. But when 2 workers each fetchAndLock one of these tasks and complete, they are not exclusive/synced anymore … so when we are unlucky, one tries to complete and gets an OLE because the other one was slightly faster.
Our solution for now is to switch from parallel to sequential for the multi-instance service task, so the next external task is created only when the previous one completed.
Questions:
- Will sequential work as expected - do you see other issues?
- Wouldn’t it be a good option to mark worker executions as exclusive, the same way jobExecutors can?
- Do you have another option to solve this?
Imho switching to a code-free (Run) C7 engine that only uses external task workers is a valid migration/preparation strategy, but when I hit issues like this one, I want to make sure there are no other pitfalls to be aware of.
Thanks for your feedback.


