Skip to main content

In my situation, I run a daily check of data within a list. Depending on dates, I may email the originator for action. I need to add a couple new checks. I built a component workflow (Email WF) that emails either Warning #1 to the originator or Warning #2 to the originator. I will be doing the component WF synchronously to avoid blocking in the database/SharePoint list.

I can call this component WF by looping in the calling WF. I would call the component WF once per loop with the ID number of the list item. This may mean calling the component WF up to 25 times each morning.

The other option would be to change the component WF to loop through a collection of ID#’s and call it with the collection. The calling WF would only need to call the component WF once with collection of up to 25 ID numbers.

My question: Which is more efficient? Calling multiple times with 1 ID or Calling once with collection of IDs.

Thanks

Hello, alhildreth

My opinion is that whether you do the loop in the calling Workflow or the component WF, it is almost the same amount of work for the Workflow engine. 
Some consideration:

  • When you call the component WF multiple times, there is a small incremental load for starting the component WF
  • It is always advisable to add a paus (30 or 60 seconds) in a loop to avoid excessive processing
  • Component WF has the added advantage of scheduling to run after hours. This is not exactly what you are looking for, but would help with performance and impact on the system.

My recommendation is to do the looping in the component WF, add a pause after sending the emails, and schedule the WF for after hours if possible.


Reply