Showing results for 
Search instead for 
Did you mean: 
New Member

How to automatically add a workflow to SharePoint Library

I'm working with a client and would like to use Power Automate workflow as part of a solution design for usage of SharePoint Document Libraries. This would be to manage the content by creating backups and also auto-archiving content once it gets to a certain age. That all seems pretty simple, there are the bare bones of templates available which will support this and I can see how a scheduled workflow against a library list could take care of modified files and back them up, or archive files as required.


My challenge is how to dynamically add these template workflows to a new SharePoint library when it is created.  This would ensure that the backup and maintenance is automatically taken care of, rather than requiring the SharePoint Admin to identify new libraries and manually add the workflow. Is that even possible? If so, then is this a feature of Power Automate or would this require coding using PowerShell?


If it can't be automated, then the idea falls on its face, as I can foresee that the manual intervention required would risk some libraries getting missed and backups not created.


Hoping someone can point me in the right direction.


Super User
Super User

Hi @SteveWedge 

My suggestion is to have a separate list with the library names whichever is created earlier or once created just update this list. In your flow, you can iterate through this list and then on the 'Apply to each' condition you can do the necessary steps to archive based on your condition. So the admin is required to update the list with the new library name whenever it is created, no need to add the flow for each library.


Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
-Sudharsan K...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

Thanks @sudharsan1985 , I hadn't thought of that approach. I suppose you could use PowerShell to generate the list, so that it is always up to date, rather than relying on an Admin, that would work, wouldn't it? I really want to make this a light touch process.

Helpful resources

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (50,275)