Power Automate: Cloning flows in same tenant pointing to separate sources

Power Automate: Cloning flows in same tenant pointing to separate sources

Power Automate - Clone flows in same environment

Table of contents

No heading

No headings in the article.

While developing solutions in PowerApps or Power Automate we would generally be doing development in the Default (Company) environment. There might be licensing costs associated with multiple environments and hence it may be an issue in getting separate development, QA or UAT environments.

It can be thought of a scenario like having single sql-server with multiple copies of Database, one as Dev and other as QA. Similarly, in power automate we can clone a flow into multiple copies in each solution and name the flows accordingly.

Steps :

  1. Extract the Deployment package using the export option at a solution level: SolutionPackage_1_0_0_1.zip
  2. Unzip the package to local computer and the folder structure shall be as shown: Image description
  3. Delete the folder : environmentvariabledefinitions and its contents (includes sub-folders , json files)
  4. Navigate to the Workflows folder and you shall find a pre existing JSON file , copy the JSON file and paste it in the same folder location. Image description
  5. Rename the copied file by renaming the Flow Name as well replaced the existing GUID with a new GUID (the GUID in the file name should be in Upper Case) You might use the following URL for GUID generation GUID-Generator
  6. Modify the customizations.xml file in the location: SolutionPackage_1_0_0_1\customizations.xml We shall modify the existing Workflows section, i.e will not be copying same section twice (copying over and modifying the copied section seems to be throwing errors) , but instead updating the existing section and the places to be modified are highlighted below (follow the instructions on the CASE (upper/lower) of the GUID as mentioned in the image below) : Image description Use the lower case GUID as and where applicable and can use the following online resource for the same :
    CaseConverter
  7. Next we shall modify the solution.xml at ~ \SolutionPackage_1_0_0_1\solution.xml a. Modify the version number 1.0.0.2 b. Update the existing RootComponent , (copying over and modifying the copied section seems to be throwing errors) Image description c. Remove the entries under:
  8. Create a zip file maintaining the underlying folder structure to generate the updated deployment package
  9. Import the deployment package and you shall find the clones of your flow in the solution Image description
  10. Define separate environment variables in the solution.
  11. For each environment use the corresponding environment variables inside your flow. Disable the flows when not required or delete them as required independently.
This way we can reuse the same environment to point to separate share point locations simultaneously from the same solution.

Reference