deployment taking a long time

Have you had a need to deploy flows in Power Automate to many SharePoint sites?

Background

In the past a common challenge has been to deploy SharePoint Designer or Nintex workflows to document libraries in all of your project sites. The deployment can take a long time.

When you want to make a small update to all projects sites as you discovered an issue with your workflow you might have to wait a while before the fixes have been deployed.

Deploy Flows vs Deploying Workflows

And even though Microsoft Flow doesn’t deploy into your SharePoint sites. You will find that with Flow your flows need to be connected your lists and libraries when you want to make your flows available on all of your libraries.

Manually Trigger Flows

When these flows are  flows that you manually trigger then you actually don’t have to create multiple copies of your flow.

Column Formatting to start a flow

With column formatting you can create a link to a flow. This can give you a link in your lists that will look something like this:

SharePoint Column formatting

All you need to do is configure your column with some json as shown below:

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "span",
"style": {
"color": "#0078d7"
},
"children": [
{
"elmType": "span",
"attributes": {
"iconName": "Flow"
}
},
{
"elmType": "button",
"style": {
"border": "none",
"background-color": "transparent",
"color": "#0078d7",
"cursor": "pointer"
},
"txtContent": "Send to Manager",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"183bedd4-6f2b-4264-855c-9dc7617b4dbe\"}"
}
}
]
}

Now imagine that you have 1000 project sites and all of these project sites have some lists and libraries that have workflows (Also include Nintex workflows here!) or Flows that start manually from a menu.

Flows from menu

To deploy these kind of Flows to all the sites, could quite quickly give you a management headache as you will need 1000 Flows. One connected to each library.

With the column formatting option however you can have a single instance of a Flow being called from all Flows. Ok, that is easy isn’t it?

Well trouble is starting here.

When you run start the flows from the column formatting provided link your flow will start (if you are an owner of the flow that is). However the authentication doesn’t seem to give you all permissions that you would like. I found that when you call your flow and try to run any action within SharePoint you get all sorts of error message.

The only way to make this work however is to use two flows.

Two flows to replace the need to Deploy Flows

The first Manually started flow will start with a Manual trigger:

1st Flow

The second flow starts when a HTTP request is received.

2nd Flow

And now we can do things to SharePoint without any failure.

This will help a lot.

We only need to have one copy of the flows. There is hardly any deployment needed. Just the column formatting needs to be deployed. Once you’ve deployed the column formatting you can update your flows in a single place.

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as a Principal Architect at HybrIT Services Ltd. You can contact me using contact@sharepains.com

23 thoughts on “Deploy flows to all your project sites, or maybe not!”
  1. Im trying to get this to work.
    I want to trigger the flow using manually trigger and get the data for the selected item and post that data back to the second flow. So i need to get the item id and the list url. Is this even possible?

    1. Hi Jimmy,

      This also gives you more information on how to do the column formatting and sending the parameters:

      https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting

      I actually ended up using a WorkPoint ( https://www.workpoint365.com/products/workpoint-365/ ) based solution where we called a PowerApp and the Powerapp would then start the flows for us, but the idea is similar. However WorkPoint did make it easier to pass in the parameters.

      1. Thank you for answering. Im pretty new to this.
        But do i understand it correctly if i say that in my column formatting i should be able to collect the url and item id and forward this to the new flow?
        is it in the txtcontent @currentfield?

      2. you can also refer to other than the current field by using a construction like shown below for due date. just make sure that the data needed is in a field.

        {
        “$schema”: “https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json”,
        “elmType”: “div”,
        “debugMode”: true,
        “txtContent”: “@currentField”,
        “style”: {
        “color”: “=if([$DueDate] <= @now, '#ff0000', '')"
        }
        }

  2. Thank you so much for answering.
    So i figured out how to get the item ID, itemURL, fileName and FileId.
    Im wondering how can i get the List id or list name and Site Address? Just like the trigger When an item is created provides?

  3. Thank you i ended up using split and compose as the itemURL contains everything i need 🙂 Really cool post and it has helped me a lot.

  4. Do i have to share the first flow with all users that should be able to trigger it? Seems i have to make them owners for the flow to run? This is the first flow with manually trigger that i have in the sharepoint list. Getting an error if i dont share it with the user and make the user a owner of the flow

  5. What’s being composed in the second step of the manually triggered flow? As far as I can tell, that manual trigger doesn’t have any inputs you don’t expressly ask the user to give you.

  6. I have a similar topic and absolutely share your idea and approach. However, my flow is not with instant trigger, rather with for a selected file. And I found something interesting.

    the flow “For a selected file trigger” is linked to a given site/lib. this flow has id=”123″
    now In another site and/or lib, I format a column with “executeFlow” and the Id of that flow.
    “elmType”: “button”,
    “customRowAction”: {
    “action”: “executeFlow”,
    “actionParams”: “{\”id\”: \”123\”}”
    },
    I push the button for fileA
    Turns out I am now able to lauch the flow from the button in the new context of the fileA. Without changing anything in the flowconnection
    1Flow:NLib.??? is this documented somewhere?

  7. Hi Pieter,

    Perhaps this post was inspiration for our new product, Trigr 😉

    We launched it for exactly this use case…deploying a single flow across your entire SharePoint estate. Would love to hear what you think!

    https://www.encodian.com/products/trigr/

    It can also collect user input through configurable forms e.g. a people picker so the automation knows who to send an approval request to. And we’re working on more governance features e.g. Azure Directory based access rights to automation.

    Happy to set you up with an account if its of interest….

    1. Before this was implemented by my clients there were many throttling issues. By optimising the flows I managed to get 100s of sites created and subscribed. Then the flows triggered by the subscription flows needed optimising too. Now there are now throttling issues left

    2. Before this was implemented by my clients there were many throttling issues. By optimising the flows I managed to get 100s of sites created and subscribed. Then the flows triggered by the subscription flows needed optimising too. Now there are no throttling issues left

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue Reading