cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Site workflow looping to update records

I created a site workflow that I believe is not suggested and maybe not best practice. I have been trying to avoid using scheduled site workflows since they are not available in office 365. However, I created a workflow last week for a business user that loops through all items(several ~800+) in a list and starts a workflow for each item.

The purpose for the scheduled workflow is to update the static calculated column field daily based upon a date field(days until due). This business user wants this calculated field(days until due) in the list to be updated daily(dynamically) and of course SharePoint is not capable of performing this update automatically.

I am using the collection and call web service technique for the parent workflow. The child workflow for each record is set to update a field in the list. This causes the calculated column to re-calculate. The workflows completed for the first few days but, it seems our farm has started to slow down (other reasons) and the workflows keeps erroring out every morning. They are set to run early in the morning during low interaction.

I would like to know thoughts about this setup.

Here are a few questions:

Should I discontinue using this workflow? 

Is there a better way to achieve the same results?

What are opinions on Site workflow like this type? (my past thoughts were to avoid)

Does anyone use this type of setup currently?

Thanks in advance for your replies!

Richard

Labels: (2)
Tags (2)
0 Kudos
Reply
1 Reply
Workflow Hero

Re: Site workflow looping to update records

Let me assume that the user wants to go to a dashboard or view of a list and see all their items in the list and see how many days until the item is due. If this is a list view need (that sharepoint can't do well on its own) you can create a JSLink to provide this field capability using Javascript, or use the content search webpart to pull in the list and use a display template. The javascript can insert a field that dynamically displays the days until due number. Both are supported by O365, yet the JSLink do not yet work on modern lists, but SPFX will on modern pages. 

So if you transition to only having a due date field, then let the display provide a "days until due" then you do not need any workflow for this help.

Otherwise your stuck with a bunch of workflows that will promise performance issues. This is because SharePoint can only start 15(default value) workflows in the web application app pool at once then queues them up. So it will take a while to start 800 at once in a loop. Loops can still execute a batch of items, so don't think you are starting them one at a time unless you pause between each (which is a 5 minute pause minimum). 

Accept as Solution Reply