In a "Sequential Multi Instance" process, can the remaining elements be managed even if an error occures on one element?

I’m a complete newbie! Sorry in advance if my question is very basic. I am using Camunda 7.X.

I have a “Sequential Multi Instance” process that calls a sub-process for each element in a collection.

It seems that if the sub-process for one of the items in the collection fails, the whole super-process stops: not all items are managed.

Is there a way to make a “Sequential Multi Instance” process run the sub-process for every item, even if one of them fails?

Or do I need to use a “Parallel Multi Instance” process to get all items managed? I’d prefer to run one item at a time, not all at once.

Can you show me your model?
There are some ways of doing this - is basically depends on how the “failure” happens.
What I would do is throw a non-interrupting escalation event from the sub-process and then have the instance end normally. The error will then be handled outside of the scope of the multi-instance

1 Like

Thank you for the reply! Here’s an example model.

For each type of candies I want to run the sub-process. If the sub-process fails for one type, I still want to run the sub-process for the other types.

In the sub-process, I get all the candies of the current type and, for every candies of this type, I want to “update” it. If the update fails for one candy, I still want the remaining candies of the same type to be updated.

Note that all Tasks are external, with no human interaction.

Ideally, at the end, I will have tried to run the ‘update’ for each candy and I will see a certain number of red dots for the problematic updates.

What exactly needs to happen if an Update Candy service fails? Do you need to log it in some way or can you just catch the error and move on to the other instances?

Just catch the error and move on to the other instances.

The error will need to be investigated and fixed manually. But this manual fix is not part of the workflow. The job of the workflow is to try to update the candies and display errors, if any.

Did I say something I shouldn’t have? :smile:

Maybe we’re using Camunda in a way that is not appropriated?

Hi @joiku,

no, it’s all OK.

The best way to handle the original question is the parallel multi instance, then all other elements will be processed, the failed elements will be marked with incidents in the Cockpit and the process execution stops after the subprocess until the incidents are resolved manually. You need only the correct async before checkmarks, if you use JavaDelegates as implementation for your service tasks. If you choose the external task pattern for service tasks, it will run out of the box.

If you want to keep the sequential multiinstance, you can catch the error with an error boundary event and throw the error in your service task implementation. The error boundary event should be followed by an end event to complete the subprocess instance. You can find more details about error events here: Error Events | docs.camunda.org

Hope this helps, Ingo

Thank you @Ingo_Richtsmeier !

I’ll try that.