locked
Is it possible to keep a SharePoint Workflow working perpetually? RRS feed

  • Question

  • I have been trying for weeks to get a workflow to run continuously for each of the items in a SharePoint List.  Once a day I want to check an item's date and send an eMail at the right time.

    After the eMail is sent (or not), I use a "pause for 1 Day" in the workflow logic, followed by an update of an innocuous item in the list element, and I have set the Workflow to be launched by all three methods: manually, as well as when an item is added, as well as when an item is updated.

    Rather than keeping the workflow running as expected, the workflow "Completes" after the pause of 1 Day, and has to be manually launched for each item again.

    Is this because a workfow cannot update the list item associated with it?  Do I have to somehow involve an external workflow to "walk" the list and turn the workflow back on for each element?  What is the purpose of the "Pause" feature? I see a "Stop Workflow" action, how do I get Workflow to realize it has not completed?

    I thought Pausing, followed by an update of the current item should relaunch an instance of the workflow, since I specified the "launch when item has changed" option.  Is that not what the SharePoint Designer Workflow process can do?

    Please help if you can?

    Thanks!

     


    Chas Roberts
    • Moved by Mike Walsh FIN Wednesday, March 23, 2011 5:52 PM workflow questions go to the workflow forum (From:SharePoint - General Question and Answers and Discussion (pre-SharePoint 2010))
    Wednesday, March 23, 2011 5:06 PM

Answers

  • Hi Chas, in most SharePoint configurations SP does not like to initiate a workflow from a change made by a workflow - it only likes users changes.  This is by design to avoid accidentaly creating an endless workflow loop which could spawn numerous email notifications, etc. as well as consume a great deal of the server's resources.

    If you download & install these free "Useful SharePoint Designer Custom Workflow Activities" it includes an action of "Start another workflow".  You can add this action to the very end of your workflow (conditionally, if that date you want is met).  You must manually type in the workflow's name (the same name of the workflow you're adding this activity to) and tell it to run on the current item.  That will keep your workflow looping continually until the date is met.

    download the custom activities here:  http://spdactivities.codeplex.com/

    I think you'll also find the other activities included in that package very useful as well - I don't know what I would do without them.

    • Marked as answer by Leoyi Sun Tuesday, March 29, 2011 9:47 AM
    Wednesday, March 23, 2011 5:22 PM
  • I hope it works for you.  I would like to make a correction though, you want to add that action to run if the date you want is NOT met (I previously stated when the date IS met).  If it's not met, it will restart the workflow and check daily.  Once the date is met the workflow will be "completed" and not re-run.

    Let me know if you run into any questions.

    • Marked as answer by Leoyi Sun Tuesday, March 29, 2011 9:48 AM
    Thursday, March 24, 2011 5:48 PM

All replies

  • Hi Chas, in most SharePoint configurations SP does not like to initiate a workflow from a change made by a workflow - it only likes users changes.  This is by design to avoid accidentaly creating an endless workflow loop which could spawn numerous email notifications, etc. as well as consume a great deal of the server's resources.

    If you download & install these free "Useful SharePoint Designer Custom Workflow Activities" it includes an action of "Start another workflow".  You can add this action to the very end of your workflow (conditionally, if that date you want is met).  You must manually type in the workflow's name (the same name of the workflow you're adding this activity to) and tell it to run on the current item.  That will keep your workflow looping continually until the date is met.

    download the custom activities here:  http://spdactivities.codeplex.com/

    I think you'll also find the other activities included in that package very useful as well - I don't know what I would do without them.

    • Marked as answer by Leoyi Sun Tuesday, March 29, 2011 9:47 AM
    Wednesday, March 23, 2011 5:22 PM
  • Hi Melli111,

    This may be just what I needed!

    Thanks for your help!

     ©®


    Chas Roberts


    Wednesday, March 23, 2011 5:33 PM
  • I hope it works for you.  I would like to make a correction though, you want to add that action to run if the date you want is NOT met (I previously stated when the date IS met).  If it's not met, it will restart the workflow and check daily.  Once the date is met the workflow will be "completed" and not re-run.

    Let me know if you run into any questions.

    • Marked as answer by Leoyi Sun Tuesday, March 29, 2011 9:48 AM
    Thursday, March 24, 2011 5:48 PM