How to continue flow execution after an error

By | May 23, 2021

When handling errors in the Flows, we can add parallel branches so one of those would run on success, the other one would run on error.

However, in the example below, there is a Flow with two parallel branches configured that way, and, even though “On Error” branch is there, the Flow would only execute that branch, and it would not continue from there:

image

What if I wanted to handle an error, but, instead of having the flow terminated, I’d need it to continue from there? The specific scenario I came across recently is having to loop through a bunch of Dataverse records, so that, for each record, there would be actions in the loop. Some of those might fail, and, if they do, I’d need to log an error. However, that should not prevent the flow from processing all other records – it should simply continue to the next record.

Turns out this is doable, but it needs to be done differently:

image

If you wanted to handle an error, you could create two parallel actions – one of them would run “on error”, another one would run no matter what (see above). In the one which would run when the previous action had failed, you could, then, do error handling.

In the one that would run “no matter what”, you basically would not do anything at all – just need some action there, though, so I used “Compose” in the example above.

This would now allow the Flow to proceed to the next step even when an error happens, and it’ll look like this:

image

I am not sure what kind of logic apps/power automate rules are at play here, but, it seems, this way we can implement error handling while still allowing the flow to continue after an error.

PS. I might combine this with the “scope” if I wanted to add error handling not just for a single action, but for the whole scope.

Leave a Reply

Your email address will not be published. Required fields are marked *