One of the coolest features of Microsoft’s Flow is the ability of export and import a flow as a template. You can easily share complete and complex flows in a file with anyone.

Microsoft provides a great list of templates, but you can create your own and share them like I’m doing here.

In the following sections, I’ll explain how to create a template, the contents of the exported file, and how to import it.

Creating a Template

Just choose the flow you want to export and click the Export dropdown:

You can get it also from the Flow’s details page:

There are two ways to export the flow:

  1. Package (.zip)
  2. Logic Apps Template (.json)

We’ll focus on the package option. I’ll explore the Logic Apps Template in future articles.

Pick the Package option:

There a few things to take in consideration:

  1. You can name the flow anything. The user can choose the name in the import process.
  2. Remove the Environment. If the users are within the same company, this may not be an issue since they share the same environment, but if they don’t then the default value will be an environment that doesn’t exist for that user. If the value is missing, the import process will import the flow to your default environment.
  3. Import Setup. You have the option to say that you want to import the package as an update to an existing flow or as a new one. You can change these options in the import process, but I recommend using the New, even if the Update is the default option.

Importing as new will have several advantages:

  1. The user may override a current flow with the same name by accident.
  2. If the user wants to override a flow, he/she needs to select it explicitly.
  3. New is (in my opinion) the most frequent option and should be the default one.

Just click Export, and you’ll get a sharable .zip file.

 

File contents

The file is relatively technical so that I won’t go into much detail about its content. You’ll only need to open it in rare cases like this one, but here is a high-level description of the contents of the file.

Here are the packaged objects:

  1. Flow’s steps – The export process will wrap all steps and connections contained in the package.
  2. Connections – The export process will package the connections’ necessary information without the credentials or locations.
  3. Flow’s metadata – The information that you filled-in above
  4. PowerApps – Any created PowerApp.

The process won’t package:

  1. Custom connectors. You need to re-create them manually before importing the new flow.
  2. Connections. The export process won’t include in the package any connections that need credentials. It will keep only the necessary information so that you can re-map it in the import process.
  3. Roles and Permission. The export process won’t include any roles or permissions in the package. The user will create them manually after they import the package.

Importing a template

To import a template is even simpler. Just select Import in the main screen and select the .zip file.

The import process will now upload the file and parse it. You’ll be able to check the details of the import process in the following screen.

The import process will fill in the fields based on the package’s data, but you can rename any of them as needed.

You will also need to map the exported connections. The import process will help you in this by flagging the missing ones on a screen like this:

A new screen will display the existing or provide you the possibility to create a new one:

To finalize just press Import. The new Flow will appear in your flow list.

 

Limitations

  1. Currently, you cannot re-map connectors. For instance, if you’re using a SharePoint list connection, you cannot change it to a SQL Server table.
  2. The export utility can’t, for now, export any custom connectors. If you want to re-use them, you need to create them again.
  3. You need to re-add any roles to the new flow. The export utility won’t include then in the package file.

References

Have a suggestion of your own or disagree with something I said? Leave a comment or interact on Twitter and be sure to check out my other Flow articles.

Featured Image by chuttersnap on Unsplash

Manuel Gomes

I'm a Project Manager with experience in large projects and companies. I've worked in the past for companies like Bayer, Sybase (now SAP) and I'm currently working for Pestana Hotel Group.

View all posts by Manuel Gomes →

Leave a Reply

%d bloggers like this: