How come I didn’t know my Flow failed???

Well, turns out the failure notifications all go to a configured account, and then only once a week. A little late to prevent user impact.

To help mitigate this risk, I started using a Create Item task following a task I wanted to know about failing and set the “configure run after” to “has failed”. This created an entry in an Error Log list on the same site and I just configured an Alert so I would know when an entry was created. That worked, but some flows have far too many tasks to do this every time.

Introducing the Scope task allowed me to group a related set of tasks together and add only one Create Item with “has failed” configured. Much simpler and you can add notes to the Create Item to help identify what Scope failed.

Guess what happens now? Sure, the task fails and Create Item works, I receive an alert, but the Flow itself no longer fails. Finding the correct run to check took a little more time.

Time to add a Terminate task after the Create Item to force the flow to fail, even though it failed already because was not telling us on our Run History. However, if there are more tasks to complete, we need to put both the Create Item and Terminate tasks into a Scope, set “configure run after” to “has failed”, then the next task needs have “configure run after” set to “is skipped” to allow the remaining tasks to run when there is no failure.

Lastly, if you want more information about what actually failed, well we need to add some details to the Create Item. Side note, I created my Error Log list with only a few fields,

  • Title – I put the name of Flow here
  • ListURL – I put the URL of the list with which the Flow is interacting
  • IDofRecord – the above list ID for the record which it failed upon
  • ItemVersionNumber – if the list allows versioning this could be helpful
  • ErrorInformation – here I was entering the name of the Scope task that contained the failure

Okay, so a little more than lastly. With a little searching online here I found I can get more information about the actual error to pass into my Error Log. Using the expression outputs(‘your_action_name’).body (without .body you get StatusCode information also) I can get the actual error message we find inside the Flow History. From Adam Toth’s article above, “Note that your action name needs to be in single quotes (not double!), and if you have spaces in your Action name (which most do), you’ll have to escape them with underscores instead.” Keep in mind, this does NOT work if you try to do this with the Scope object as the action name to get error information for a task within. Instead, you will need to add this expression for each task you want details about when failing. Tasks that don’t fail will simply return a set of brackets ({}).


דירות דיסקרטיות בצפון · July 27, 2022 at 3:41 am

Greetings! Very helpful advice in this particular post! It is the little changes that make the most significant changes. Thanks for sharing!

Mark · September 8, 2022 at 1:10 am

Thanks for your blog, nice to read. Do not stop.

Leave a Reply

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