Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Restore your Power Automate flow from a backup

Posted on February 11, 2024February 18, 2024 by Tom

“It’s great to have a backup, but what about building another Power Automate flow that’ll restore the flow from this backup?”


Last week I wrote an article on creating backups of your Power Automate flows in form of JSON files. The article ended with the possibility of looking into the JSON code to find the changes. Why not take it one step further, to take the backup and actually use it to restore a flow? To build another flow that’ll rewrite the current flow from the backup?

Triggering the flow

Since you’ll have a lot of backup files, I’d start from the trigger ‘For selected file’ (unless you’re building a PowerApp for the solution). Keep in mind that for the context menu to work it must be in the Default environment, otherwise use a different approach.

Connect the trigger to the library with flow backups and get their content.

Power Automate restore backup

There’re a few pieces of information in the JSON file you’ll need and which you can extract using expressions.

Extracting the backup data

Firstly, there’s the flow id, a unique identifier of the flow. Since you want to update the existing flow to previous version, you’ll have to get this id.

body('Get_file_content')?['name']

Secondly, you’ll need also the flow name to tell the updating action what should the flow be called. Since it’s the same flow, extract it from the JSON.

body('Get_file_content')?['properties']?['displayName']

Next, the whole flow definition, all the actions and their configuration inside the ‘definition’ property.

body('Get_file_content')?['properties']?['definition']

And finally, the connection references – what connections the actions use.

body('Get_file_content')?['properties']?['connectionReferences']

Restoring the flow

But before you get to the actual flow restore, there’s one middle step to take. The connection references as seen above have too much information, sometimes causing problems during the update. Reduce the properties only to connectionName and id with the ‘Select’ action.

Power Automate restore backup

Now, knowing all the inputs, you can add the ‘Update Flow’ action from the ‘Power Automate Management’ section. Reference all the inputs and decide whether the flow should be On or Off after the update.

Power Automate restore backup

Here it’s connected only to a single environment ‘Pipeline_DEV’, but it’s also available in the JSON export in the id property. You can extract it from there with an expression.

split(body('Get_file_content')?['id'],'/')[4]

Summary

As you can see in this article, it doesn’t end with creating a backup of the flow, you can use Power Automate also to restore it. The exported JSON file contains all the information you need, just extract it with a few expressions, adjust the connection references with the ‘Select’ action, and update the flow.

Yet I have to mention here that I encountered a few flows that I wasn’t able to restore using this process. Most flows were working fine, but in a few it had some problem with the ‘HTTP request to SharePoint’ action in the flow definition… But even knowing this I think it’s such a simple and useful solution that it’s worth a try.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Leave a Reply Cancel reply

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

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes