Have you had a need to deploy flows in Power Automate to many SharePoint sites?
Background
Table of Contents
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.

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:

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.

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.

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

The second flow starts when a HTTP request is received.

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.
Just want to remind that to be able to use the custom HTTP action you need to have Flow Plan 1 or 2.
https://techcommunity.microsoft.com/t5/Office-Retirement-Blog/UPDATED-Updates-to-Microsoft-Flow-and-PowerApps-for-Office-365/ba-p/289589
Yes,indeed you do need a premium plan.
Can you please give some examples for each of the steps in the workflow.
Thanks
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?
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.
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?
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', '')"
}
}
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?
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.
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
I think that the answer is yes.
We ended up with a PowerApp letting users select the flows from a drop down in the app. This then avoided this problem
HTTP is now premium… This brings an additional challenge…
Hi Elia,
It does indeed mean that there is an additional cost. But imagine how much it costs to deploy a workflow to 1000 sites.
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.
Hi Chris, that is just to collect a specific part of the input. It isn’t really needed .
For Jimmy Winberg. How were you able to get what you passed with the URL into the Flow?
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?
https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#create-a-button-to-launch-a-flow
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….
Hi, have you faced any throttling or performance issue with this approach?
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
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