Workflow loop is timing out RRS feed

  • Question

  • I have a workflow that checks the database once a day to see if emails need to be sent out to users. It consists of a Delay object set to 24 hours (I've been testing with a 2 hour delay), a stored procedure call to the database to get the list, if any, of emails that need to be sent, and then looping through the returned objects to send the emails. When it completes the looping, it then returns (loops) to the wait state. There really is not end state for this workflow as I want it to always run. The problem is that, after about 6 to 8 hours, the workflow dies. The error stored in the event log is "System.TimeoutException: The operation did not complete within the allotted timeout of 00:00:09.6539654..." I read something about how the delay could cause an issue and to put the delay in a NoPersistScope object. I am still getting the error.

    Other things I have tried:

    1. Putting the delay in the stored procedure (would check the time and return null if it wasn't the desired time), so that the workflow consisted of stored procedure and send emails and then loop back to the stored procedure to check if emails needed to be sent. It failed after 8 hours.
    2. To make sure it wasn't getting upset with the stored procedure calls, I had the original one but with just a standard email being sent with no db call every 2 hours. This died between 6 and 8 hours (ran it more than once).
    3. I wanted to see if it was a problem with the delay time so I created a workflow that sent an email, had a delay of 4 hours, sent a second email, had a delay of 5 hours, sent a third email, had a delay of 6 hours, and then sent the final email. Basically, I had it run for an extended period of time but with no loop. This did not fail so I'm wondering if it is the loop that is causing the issue.

    So, anyone else have this issue or know how to solve this? I am using the devexpress workflow tool which is built on the windows workflow foundation.

    Thank you,


    Monday, June 3, 2013 2:59 PM

All replies

  • Susan,

    From your description, I can't tell what sort of operation is encounting the timeout. Could it be the act of sending the email(s) that is somehow timing out? What are you using to send the email(s)?

    Are you persisting the workflow when it is idle? Or are you keeping it in memory? If you are persisting, what implementation of InstanceStore are you using? SqlWorkflowInstanceStore?

    Tracking information might help to determine where the Timeout is happening.


    Wednesday, June 5, 2013 11:58 PM