When would you use a "loop" in a list workflow versus "wait for item update"?

Advantages/disadvantages of each.



It's like everything in computer science: polling versus events.
When you poll (querying the status of an object in a loop), there's 2 drawbacks:

  1. It may consume unnecessary resources since code runs for nothing most of the time.
  2. There may be a delay between the time the event actually occurred and the time you poll and know it occurred.

While with an event ("wait for item update"), you have no worries like that: your workflow really sleeps till the event occurs, and you're notified immediately (note: in the SharePoint workflow world, "immediately" means "with a 5-minute max delay").

| improve this answer | |
  • But how do you stop a workflow with a "wait for item update" if the person ignores the email and the workflows? With a loop, I can end the workflow. Let's say for example, the workflow is waiting for an item update and the update never occurs and it's past the due date. How do I end that workflow? I've seen several workflows like that at my current place of employment where the event never occurred so they were just running for 12 plus months. – Patti N Jan 19 '17 at 21:49
  • @PattiN One possibility is to pause inside a loop. Having a long pause will prevent it from consuming too many resources. – jpaugh Jan 18 '18 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.