Skip to content

cupo365/default-flow-with-error-handling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Default flow template with error handling

Table of Contents

Summary

This flow template can be used as a default template for every flow you make. It contains a try-catch-finally mechanism by using scopes and has functionality to create an error stack and process this stack as a JSON object or HTML text which you then can use to notify observers via actions like Send an email (v2). Moreover, the flow contains a flow config variable in which you can configure specific context variables like a dry run or whom the observer is in cases of errors. Want to see how you can implement this flow? See minimal path to awesome.

Download .sppkg file Download the flow ZIP package here!

Applies to

Power Automate Cloud Flows

Solution

Solution Author(s)
Flow template with error handling cup o'365 (contact me)

Version history

Version Date Comments
1.0 July 2, 2022 Initial release

Minimal path to awesome

  1. Download the flow ZIP package, browse to Power Automate, sign in and import the ZIP package as cloud flow Flow overview
  2. Change the trigger. To avoid this flow having connections you would have to create, the trigger is set to manual.
  3. Configure the varFlowConfig variable Flow config variable
  4. Start building your flow inside the try-scope Try scope overview
  5. Append every container action inside your flow to the filter in the catch-scope (see screenshot below). Container actions can disguise errors within them. Therefore, each container action should be added to the 'From' formula in the filter results action in the catch-scope. By default, all existing container actions are already added to the default formula. The formula is union(coalesce(result('Scope_-_Try'), createArray(null)), coalesce(result('Scope_-_Prepare'), createArray(null))). To add an action to this formula, simply add coalesce(result('{NAME_OF_CONTAINER_ACTION}'), createArray(null)). Container actions are: scopes, conditions, switches, apply to eaches and do untils. Catch filter results action
  6. To allow the flow to notify an observer in case of an erorr: add an email action in the catch-scope if needed. To avoid the flow having connections, an email action (or any other notification for that matter) is not included, but you can add it yourself to the last condition of the catch-scope. This condition already contains a compose action with proposed input. An example of an email with this input looks like this: Error notification example
  7. Enjoy :)

Download the flow ZIP package

Download .sppkg file Download the flow ZIP package here!