Ever had a scenario where you mistakenly deleted a Power Automate flow? Or may be you created a flow and when you go back later you don’t see it.
You think someone might have deleted the flow. Unfortunately there was no way to retrieve it back. Well, no longer.
With the Power Platform 2022 Release Wave 1, you can now restore your deleted workflows. Let’s see how you can do this.
For now the feature is limited to PowerShell and you must connect to your Power Platform environment using admin account. So let’s get started.
The first step is to open up your PowerShell command as Administrator (Run as Administrator) and then make sure the latest version of Microsoft.PowerApps.Administration.PowerShell is installed. You can verify this by running the below command in your PowerShell window.
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -RequiredVersion 2.0.147
The next step is to connect to your Power Platform environment using admin account credentials. For that use the following command.
Add-PowerAppsAccount
You shall get a login prompt. Enter environment admin credentials and login.
Once logged in, you can now list the available flows in the environment including the one which has been deleted in the last 28 days only.
For that use the below command.
Get-AdminFlow -EnvironmentName Default-0650677a-acd9-4cf8-972b-4ad36aa14fd5 -IncludeDeleted $true
Here “Default-0650677a-acd9-4cf8-972b-4ad36aa14fd5” is the Environment ID. You can get it from the Power Platform Admin center.
And below is the result of the query.
I have a flow named -“Flow to Delete”. I haven’t deleted it yet. To test this, I went ahead and deleted the flow. And when I run the flow, I get the below results.
The only difference you see now is Enabled state is to set False (highlighted in yellow).
To restore the deleted flow, you need the ID of it. The ID is actually the FlowName property in the results (First property in the results).
And here goes the final command to restore the Deleted flow.
Restore-AdminFlow -EnvironmentName Default-0650677a-acd9-4cf8-972b-4ad36aa14fd5 -FlowName ceb34af2-f3e9-4140-9710-4fe8ebe9aa95
Notice the usage of the FlowName value copied from previous result.
Remember, that once restored, the flow will be turned off by default. You still need to go ahead and enable it.
Pretty neat and really great to know that Microsoft is gradually adding these cool useful features in Power Platform.
Hope this helped! You will also like the below posts.
Debajit Dutta
Business Solutions MVP
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.