Welcome to MSDN Blogs Sign in | Join | Help

Issues with the “Delay” activity in SharePoint workflows - we need your help!

Hi everyone,

 

We’ve received quite a bit of feedback about delays not working consistently in SharePoint workflows, so I wanted to touch base with you about our status and ask for your assistance. 

 

As for status, this is a top priority issue for us, and we are actively investigating as we speak!  We currently have a fix that makes things substantially better for the issues that have been reproduced internally, but we don't have enough information on customer reported issues to know if the fix will address all of them.  

 

So here’s where we need your help. J If you have any examples of workflows that have issues related to the “Delay” activity, please post a comment with details about where and how the delay is being used in your workflow, or send your VS project or SPD xoml file to “eileneh at microsoft dot com”.  The biggest obstacle has been reproducing reported issues internally, so any specific and detailed repro steps that you can provide would be extremely useful in helping us target our tests and determine if the fix will address your scenarios.

(Note: This fix is not yet available through our Customer Support Services channel, so please don’t call them to ask for it just yet.  We will do another post when an official hotfix is available, so please bear with us.)

 

Over the next couple months, we’ll be continuing our tests to hopefully get to the bottom of this issue.

 

Thanks,

Eilene Hao

Program Manager - SharePoint Workflow

Update!

Thank you everyone for your patience and for sending us your workflows and information!   I wanted to let you know that the fix for the “delay” issues is included in the Infrastructure Updates that were released on 7/15, so please download those to get this.  We did notice that there seemed to be some other causes that can be fixed from the developer side, so we put together a KB to summarize our findings and tips for working around them at http://support.microsoft.com/kb/953630/.  We hope this will be the last of the delay issues, but if you continue to run into them, please let us know.

Thanks!

Eilene

Published Friday, January 04, 2008 5:03 PM by sptblog
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Issues with the “Delay” activity in SharePoint workflows - we need ...

Interesting point at blogs.msdn.com

Friday, January 04, 2008 9:00 PM by Windows Vista News

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I actually ran into a delay problem with the out of the box version of MOSS related to the Designer Workflow that Pauses for a certain duration.  I tested it with a few minute interval and the workflow would not start up.  So I googled the issue and someone had posted an stsadm command prompt that fixed it.  I have a sinus infection right now, however if you would like I can send a link of the post when I am feeling a little better.

Sunday, January 06, 2008 2:31 AM by Becky Isserman

# Como empezar el año dramáticamente: SharePoint y el WorkFlow Foundation

Pues bien, nuevo año, nuevos desafíos, como diría mi jefe... Algo que ya había comentado en alguna oportunidad

Sunday, January 06, 2008 3:06 PM by SkunkWorks

# Como empezar el año dramáticamente: SharePoint y el WorkFlow Foundation

Pues bien, nuevo año, nuevos desafíos, como diría mi jefe... Algo que ya había comentado en alguna oportunidad

Sunday, January 06, 2008 3:08 PM by SkunkWorks

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I think that the biggest problem is related with the service that executes the delayed workflows.

As far as I understand delayed workflows are executed outside of w3wp.exe by some service that polls the delayed workflows.

According to Microsoft documentation in order to install a new workflow, we need to install workflow assembly into GAC, install feature and reset IIS, but we don’t restart that polling service, which results in two versions of the workflow being used (since the polling service is still using the old assembly).

After I deploy a new workflow, delay activities stop working and in order to enable them I need to restart server (since I don’t know which service I need to restart). After this my delay activities are working as expected.

For those who are still struggling with DelayActivity, you need to install Windows 2003 SP2 and 932394 hotfix (http://www.microsoft.com/downloads/details.aspx?FamilyID=6096ce0f-d21e-47ac-afe2-d4e1c2fce670&displaylang=en) on your servers. Also you need to remember about spawned context (http://blogs.msdn.com/advancedworkflow/archive/2006/03/21/557121.aspx)

Monday, January 07, 2008 3:08 AM by AVM

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Delay Activity is not working in State Machine Workflows. I have a complex workflow completely based on them and done other tests to find out what was wrong. The Delay has as Property TimeoutDuration - only this is taken into account and none of the code before it or initializing this timer. I tried to execute a code on the InitializeTimoutDuration but whatever is there it won't be considered, as well as code in InitializeState activity. If TimoutDuration is set to 0:0:0 the timer fires regardless of the code before it, i.e. referencing a DateTime in a list on an item. This TimeoutDuration has fixed values in the designer ranging from 0:0:0 to 1 day. I've been wondering from the very start why this value cannot be overwritten. The project will be sent to your email address and we hope you have a solution soon.

Monday, January 07, 2008 7:33 AM by SBorlea

# Issues with "Delay" activities in Workflow - Need your help!

Hi everyone, If you're having trouble with Delay activities not returning in SharePoint workflows, head

Monday, January 07, 2008 9:34 PM by Microsoft SharePoint Designer Team Blog

# Issues with "Delay" activities in Workflow - Need your help!

Hi everyone, If you're having trouble with Delay activities not returning in SharePoint workflows

Monday, January 07, 2008 10:13 PM by Noticias externas

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I have also posted this in the MSDN SharePoint - Workflow forum -

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2651760&SiteID=1

-----------------------------------------------

I am having trouble figuring out how to force the WF to persist history log entries so that I can retrieve them as a last step of the workflow.  This is a simplified example of my sequential workflow:

OnWorklowActived

LogToHistoryListActivity (begin workflow)

CreateTask

OnTaskChanged - In a while activity.  Next Step fires after this completes.

CompleteTask

LogToHistoryListActivity (end workflow)

Invoke Web Service - Retrieve all list items in workflow history list and return it

The problem is that when the last activity executes, the history list hasn't yet been updated with the final end workflow message. I am assuming that this is because the history list item hasn't actually been persisted yet to SharePoint because of the batching mechanism inherent in Windows WF.  If I invoke the web service after the workflow actually completes, the log entry is there.  I tried using the delay activity right after the log workflow end, but then I run into the delay activity bug (detailed in other posts).  Does anybody have any ideas how to get around this?

Wednesday, January 09, 2008 9:34 AM by kbodie

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Please hurry, don't follow the last sentence in this post "over the next couple of months". We need solution fast.

Saturday, January 12, 2008 9:49 AM by markoh

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I'd like also to notice that the problem in delay activity arose when during my debugging I came across some error in my code and workflow was terminated by system. And after that I coldn't run delay activity again till rebooting server. It's a strange situation for I tried to restart timer servise of MOSS but it didn't help. And this problem despait all talking is still in presens. Very sad...

Sunday, January 13, 2008 1:53 PM by Alexey_k

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

We have issues with any workflow that uses a Delay action.  Even the most basic workflow that does a delay for 5 minutes then tries to send a notification email.  The issue is quite simple - it never restarts after the delay.

At about the time you would expect it to be restarting after the delay action, there is an error in the ULS log, the details of which are:

Timestamp Process TID Area Category EventID Level Message Correlation  

11/14/2007 10:45:56.05 OWSTIMER.EXE (0x07EC) 0x0E58 Windows SharePoint Services Workflow Infrastructure 98d8 Unexpected System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow originalWorkflow, SPWorkflow workflow, Collection`1 events, SPRunWorkflowOptions runOptions)

Sunday, January 13, 2008 4:57 PM by A Douglas

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Hi

I have developed the following scenario in Worklfow and i am also facing the same problem.

I have one workflow associated with list. i invoke the workflow based on condition from code. It creats two tasks. one for first person and other for second person.

The condition is now i have to wait for 10 minits. If First person is not taking any action in 10 minits, then i have to mail him saying that your task is delaying.

then i also have to wait for another 20 minits, and if in that period also if he is not taking any action, then mail will be sent to his boss.

and task will automatically approved by system.

Same scenario is for second person, So two person is running parallelly. Here i have used parallel activity first, and then used listen activity for waiting response from both person. but delay gets never invoked.

I tried all patches and all hot fixes and also deployed new DLL version and workflow.xml again, but that also not helping me.

Please provide feedback on this.

waiting for positive response from anyone.

Thanks

Malay Vasavada

Tuesday, January 15, 2008 5:29 AM by Malay Vasavada

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I too (like so many others) found that Delay events in a State Machine workflow simply did not fire in Sharepoint. Then I found this:

Following this post:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1668527&SiteID=1&pageid=1

[Scroll down to the 21 June 2007 post by Fred Morrison]

I have found that if I restart the SPTimerV3 service in my PostBuildActions.bat after doing the deploy, the delay activities in the state machine appear to be firing correctly. This test was in my local VM, I am about to deploy this workflow to my test server and will let you know if it works there.

Further update:

• After deploying to my test server, the workflow/events were not firing.

• I stopped and restarted the “Windows SharePoint Services Timer” service and the events started firing.

Commands used:

Net stop SPTimerV3

Net start SPTimerV3

I also added these commands to my “postbuildactions.bat” file in my development project – right after the “iisreset”, and found that

Hope this helps

Tim Tuxworth

Thursday, January 17, 2008 12:01 PM by timtuxworth

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

The issue we faced is related to the time period specified in the delay activity. If the delay period is less than 10 minutes it does not work fine. When we kept the delay period more than one hour it worked but the time taken is always 2-5 minutes more than what specified.

Tuesday, January 22, 2008 9:16 AM by Mohit Vaish

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I'm not sure if this is the same issue, but since SP1 has been installed in our environments, all workflows that are set to start automatically (either when an item is created, or updated) will not kick off if the item is added by the "System Account".

This is especially an issue for environments where we have workflows set to start when items are created in document libraries that are e-mail enabled (since the timer service account is the only account that will enter those items).

These workflows will work as designed if an item is added by any other user, however items added by the System Account will not kick off the same workflow.

Also, these workflows will work as designed if started manually after the item is added by either a normal user or by the System Account.

I have not seen any further information online regarding this issue, so if anyone has a solution or temporary workaround until a final resolution is found, please pass it on.

["Brian"]

Tuesday, January 22, 2008 10:16 PM by Brian Caauwe

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I've had many problems with the delay.  After finally applying the hotfix and restarting the timer service.  My workflow rehydrates after said delay.

But now I'm experiencing another problem.  It seems that I am unable to do anything besides creating list items.  Everything else generates an error.  It is as though the assemblies aren't reloaded.  

If I try to write to the event viewer or execute code from a different class it blows up.  Is says an error has occured

???

I've tried to work around the problem by creating an item in another list and putting an ItemAdded event handler on that list.  But event handlers don't fire after the delay activity.  wtf

am I missing something

Is anybody else experiencing this problem??

please help

Reggie

Wednesday, January 23, 2008 11:54 AM by Reggie

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

See example on Robert Shelton's blog on "How to Video: Programmatically Escalating an Overdue Task as a part of a Document Workflow in SharePoint (MOSS 2007)". Example has “Delay” activity http://www.sheltonblog.com/archive/2007/11/01/how-to-video-programmatically-escalating-an-overdue-task-document-workflow.aspx

Thursday, January 24, 2008 11:02 AM by mityak

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Hi again,

I've narrowed my problem down.  I have many constants that are stored in the web.config file and when I access web.config entries after the duration activity has elapsed I get an empty string.

The funny thing is that these errors are in event handlers not in the same workflow as the duration activity.

I'm going to try Configurationmanager.RefreshSection to see if that fixes it.

does anybody else experience this??

hopefully I won't have to hardcode all my fieldnames in.

Thursday, January 24, 2008 4:22 PM by Reggie

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

@Brian

I encounterd the same issue without SP1 installed. I have a 2 machine installation with 1 web frontend and 1 app backend (the one where the incomming email smtp runs). Every once in a while, the on new event doesn't fire. I done a workaround and added code to start my wf programatically in my on new mail eventhandler.

Sunday, January 27, 2008 1:41 PM by Frank

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I managed to get the delay activity running on my dev box (with patch and stsadm setproperty). I also found out that resetting the sptimerv3 service helps, but I can't get the thing running on my farm with 1 web frontend and 1 application machine (running indexing, smtp, project server).

Any Ideas?

Frank

Sunday, January 27, 2008 1:48 PM by Frank

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

We also had problems without SP1.

Tuesday, January 29, 2008 8:06 AM by ITSMdoc

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I have installed Windows 2003 SP 2 and .NET 30 sp1 and WSS sp 1 and Office servers sp 1.  I cannot install the hotfix mentioned elsewhere in this feed because the installer raises an error saying that I do not have the product installed that the hotfix pertains to.  Now I am having issues where the delays are not working. i have no idea if they were ever working.  Is there a need to install the hotfix even after installing the WSS sp?  How can I?

Friday, February 01, 2008 5:45 PM by Charles Cooper

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I use DelayActivty) as one of several "legs" of a ConditionedActivityGroup that includes a Replicator of WssTaskActivty (from ECM Starter Kit 1.2).  The DelayActivty is used to determine when, if ever, to send scalding reminder emails to those lazy good for nothing folks who ignore their assigned tasks :-).  

Essentially, the common Due Date/Time of all tasks minus a # of days (minutes during testing) to send out Reminders is used to determine how long to set the DelayActivity's TimeOutDuration.  Example:

           // Figure out how long to wait - make sure you have the HotFix in place or this won't work

           TimeSpan ts = new TimeSpan(0);

           ts = ReminderDate - DateTime.Now;

           DelayActivity da = sender as DelayActivity;

           da.TimeoutDuration = ts;

When the DelayActivity "pops", it checks the list of tasks that the Replicator created to see which ones are not complete and sends Emails to them.

Another DelayActivty, which is part of the same CAG does a similar calculation on DueDate:

           // Figure out how long to wait - make sure you have the HotFix in place or this won't work

           TimeSpan ts = new TimeSpan(0);

           ts = DueDate - DateTime.Now;

           DelayActivity da = sender as DelayActivity;

           da.TimeoutDuration = ts;

When the DueDate monitoring DelayActivty "pops", it sets the When condition of yet another leg of the same CAG to True.  That other leg of the CAG spins through the list of tasks and for any that are not completed, issues an AlterTask command to force the OnTaskChanged event to fire. Inside OnTaskChanged, I check for a special "AutoCompleting unfinished task" indicator and set the Description/Outcome of that task accordingly.

DelayActivty is crucial to being able to have tasks WITH ENFORCEABLE DEADLINES WITH REAL CONSEQUENCES FOR NOT DOING YOUR JOB (COMPLETE YOUR ASSIGNED TASKS ON TIME).  None of the out-of-the-box MOSS workflows provide this ENFORCEMENT OF TASK DUE DATES.

Once I put all the necessary HotFixes in, DelayActivity works fine in Sequential-type workflows.  Alas, as others have noted, it doesn't work in State Machine workflows.

Thursday, February 07, 2008 9:42 AM by Fred Morrison

# Hotfix fails to install

If you try to install the HotFix and it fails to install because "the product the hotfix applies to is not installed" - I found that if you uninstall and re-install the .net framework 3.0, the hotfix will then install. Hope this works for you.

Tim

Friday, February 08, 2008 11:10 AM by timtuxworth

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Hi everyone,

First of all, thank you for all your feedback!  Keep it coming!  It looks like there may be multiple types of problems people are encountering that we haven't seen, so your data is super valuable.  

I also wanted to make sure you try the timer reset workaround that people have suggested; some of you have noticed that doing a reset of the timer service seems to fix things, so I wanted to clarify why this happens.  

Workflows start off in w3wp.exe, which loads the workflow assembly from the GAC.  When it hits a delay, it puts an event in the queue for OWSTimer.exe to pick up at the scheduled time. When the time comes, OWSTimer loads the workflow assembly from the GAC.

However, if you modify and redeploy the workflow assembly into the GAC and do an iisreset, starting a new workflow will make w3wp pick up the new one, while OWSTimer still has the old one cached.  Because of this mismatch, the workflow may crash and appear to hang indefinitely.  Thus, when you reset the timer, it flushes the cache, and on next load, it picks up the same assembly as w3wp.  Hence your workflows work again.

To help us find bugs other than this, please send me mail or post if you still have issues AFTER trying the following prerequisite workarounds:

1) Install the WF delay hotfix (http://www.microsoft.com/downloads/details.aspx?FamilyID=6096ce0f-d21e-47ac-afe2-d4e1c2fce670&displaylang=en)

2) Run the following commands on your front ends:

Net stop SPTimerV3

Net start SPTimerV3

When you send in info, it would be great to have the following additional information if available (feel free to follow up with this info if you haven’t sent it to me already):

1) Are you using WSS or MOSS?

2) What are the details of your symptoms?  Delay does not return ever, or delay returns at a much later time than expected (and how much later)?

3) What is your workflow timer interval set to?  You can use the following command to find this:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsa

dm -o getproperty -propertyname "job-workflow" -url http://localhost

4) Check the WSS_Content SQL table to see if an event is actually registered at the specified time with the following query:

SELECT * FROM ScheduledWorkItems Where id = '2761E667-FECB-4A0B-8F4E-5D38C0644DA0' <- insert your broken workflow ID guid

Let me know if the event is missing, or if it was scheduled but never got picked up.

5) Are you running on a production environment with other types of load on your system, or is it an isolated test environment?

Thanks,

Eilene

Monday, February 11, 2008 4:55 PM by Eilene Hao

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Someone wrote earlier: "I have many constants that are stored in the web.config file and when I access web.config entries after the duration activity has elapsed I get an empty string."

I had this problem too (empty string in the NameValueCollection after the workflow dehydrates/rehydrates).  Solution: make a copy of the Name/Value pairs to your own keyed list like I did at the very start of the workflow.  Only look for keys/values in that 'private' list for the rest of the workflow.

It stinks to have to do this, especially if you allow people to change web.config during the course of the workflow (which my solution won't pick up), but if the alternative is to risk the 'empty string' issue, what can you do?

Tuesday, February 12, 2008 8:53 PM by Fred Morrison

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

In my development environment, my "job-workflow" interval is set to 2 minutes (default is 5), an extra level of overhead I can handle.  It allows me to "compress time" (days become minutes) in my Delay Activities to wait small amounts of time that won't get 'rounded up' to the nearest 5 minute interval like what happens in production (where the 5 minute minimum is still set by default).

Tuesday, February 12, 2008 8:57 PM by Fred Morrison

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

"Because of this mismatch, the workflow may crash and appear to hang indefinitely.  Thus, when you reset the timer, it flushes the cache, and on next load, it picks up the same assembly as w3wp.  Hence your workflows work again."

Which is precisely why I invoke my SpEnema.bat to stop/start all of those services.  Natually, I only do this in my private development environment.

Tuesday, February 12, 2008 8:59 PM by Fred Morrison

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Can someone tell me how can we track the active workflows on a site and more precisely the active delay activities and in how long they are due to "fire". Are there any administration tools or even API calls that can be used for such chores?

I don't seem to be able to track those anywhere to make sure that all those are still being tracked. As well, is there any sure way to "re-hydrate" all the workflows, as I am now seeing that often when we edit and recompile our workflow that the delay tasks especially don't seem to start back.

Saturday, March 01, 2008 6:24 PM by Alain Picard

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I had installation problems with the HotFix too.

I'm having a lot of problems with DelayUntil on two different MOSS 2007 installations. I'm running Win2003 SP2 and Sp1 for MOSS 2007.

It appears the delay isn't rehydrating.

I wrote a windows service with a timer that runs very 5 minutes to replace the workflow. It works great on one of my servers, but on the other it doesn't work. There's a rights issue with who I specify as Log On. On both servers I'm an admin and a sharepoint admin.

When I call site.AllWebs.Count, it sets an access violation exception. I ran into this problem at first on the first server, but when I changed the log on to an admin, the problem went away. It doesn't go away on the second server. What rights do I need to have access all sharepoint data in a process outside of a sharepoint w3wp process?

Tuesday, March 11, 2008 10:21 AM by Charlie

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

We have MOSS (no SP1) on 1 server and SQL 2005 on another server.

The workflow is build using SharePoint Designer and it uses the activity “Pause until Date”. It worked well for a couple months. Then we lost connection between the web server and database and we did a Shutdown + Restart for the web server followed by stop+restart SPTimerV3.

On ScheduleWorkItems table the pending workflows (created before the crash) have “InternalStatus”=9. Those created after and pending have “InternalStatus”=8.

Those created before the crash are still pending even the scheduled date has passed.

Monday, March 17, 2008 11:13 AM by Robin

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Hello,

the delay activity is a mysterious control... After a lot of troubles I was ables to run it in my workflow. But during testing I came across a problem - it works unreliable in case of using within replicator activity. I had to add / remove users by using replicator's property CurentChildData and accordingly some new tasks were created in parallel. But! Unregularly, after the delay activity in new task was initialised by new date, the process of creating next new task hanged. There was no any errors, the workflow seemed went "to sleep". Suddenly, after more or less time passed the workflow awoke and did all the work to rest well. Very strange.... Of course, this process includes using many threads and not simple. But any way I don't know how to overcome the problem. Any ideas? (Without particular hope).

Thursday, March 20, 2008 7:28 AM by Alexey

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

What does InternalState = 8 mean when I run the following query on my dev machine after starting a workflow that has a DelayActivity in it? Also, why do the times (DeliveryDate, Created) appear to be Universal Coordinated Time?

Note how I was lazy and used a 'everything in the past 2 weeks' WHERE clause in my query instead of plugging in a specif GUID.  In my case, I only get back one row, so my laziness is 'close enough' :-)

SELECT [SiteId]

     ,[Id]

     ,[DeliveryDate]

     ,[Type]

     ,[ParentId]

     ,[ItemId]

     ,[ItemGuid]

     ,[BatchId]

     ,[WebId]

     ,[UserId]

     ,[Created]

     ,[BinaryPayload]

     ,[TextPayload]

     ,[ProcessingId]

     ,[ProcessMachineId]

     ,[ProcessMachinePID]

     ,[InternalState]

 FROM [WSS_Content].[dbo].[ScheduledWorkItems] swi

WHERE swi.[Created] > DateAdd(Week, -2, GetDate())

ORDER BY

swi.[Created] DESC

Tuesday, March 25, 2008 2:33 PM by Fred Morrison

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Follow-up question: what does [InternalState] = 9 mean? I ask because it would appear a DelayActivity that should have 'popped' already (like yesterday) is stalled for some reason.  Here's the query (with a GUID specifi to my situation):

-- What DelayActivities were supposed to "pop" in the last few days but didn't?

SELECT Convert(varchar, GetDate(), 120) [CurrentDateTime]

     ,Convert(varchar, wf.[Created], 120) wf_CREATED

     ,wf.[SiteId]

     ,wf.[Id]

     ,Convert(varchar, swi.[DeliveryDate], 120) DeliveryDate

     ,[Type]

     ,[ParentId]

     ,wf.[ItemId]

     ,wf.[ItemGuid]

     ,[BatchId]

     ,wf.[WebId]

     ,[UserId]

     ,Convert(varchar, swi.[Created], 120) Created

     ,[BinaryPayload]

     ,[TextPayload]

     ,[ProcessingId]

     ,[ProcessMachineId]

     ,[ProcessMachinePID]

     ,swi.[InternalState]

 FROM [dbo].[Workflow] wf

 INNER JOIN [dbo].[ScheduledWorkItems] swi

 ON wf.Id = swi.Id

-- WorkflowInstanceID=%7b79D4F9DF%2d0021%2d4BD3%2dA10D%2dF2427D95EE2F%7d

WHERE 1 = 1

--AND swi.[Created] > DateAdd(Day, -4, GetDate())

AND wf.[Id] = '79D4F9DF-0021-4BD3-A10D-F2427D95EE2F'

Wednesday, March 26, 2008 11:27 AM by Fred Morrison

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I have an entry in Wss_Content database, table ScheduledWorkItems, that shows Created = 2008-03-28 20:33:10, DeliverDate = 2008-03-31 20:50:54, InternalState = 9.

Is it safe to delete this row?  It seems to be associated with a DelayActivity timer for one of my Workflows that was supposed to be delivered two days ago.

Or will SharePoint eventually clean this up by itself after some period of time (now isn't that ironic!) passes?

Microsoft: please publish the meanings of the values for InternalState so we can help you out.

Wednesday, April 02, 2008 10:03 AM by Frederick Morrison

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

My workflow should be able to send a reminder email on a date in future (that is collected from the user). How can I set up the Delay activity for this purpose?

Wednesday, April 02, 2008 12:09 PM by Jake Morris

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

When you can fix this bug????

Three months passed,what did you do???

Monday, April 07, 2008 12:58 AM by Hate you

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

As far as I know, InternalState = 8 means Cancelled. By why? I have the same issue, my internal state for scheduledworkitem is 8. In Workflow History I have entry: Workflow failed to run, but status of the workflow is still In Progress.

Delay activity should re-run the workflow every 12h, but second run was after 24h.

Workflow created on 5PM, first entry delay with failed to run on 5AM next day, then in a second another entry at 5AM, then next entry after 24h with failed to run. Las run of the workflow is 6AM. strange.

24/04/2008 05:25 Error  System Account

Approval Workflow failed to run.  

24/04/2008 05:25 Error  System Account

Approval Workflow failed to run.  

25/04/2008 05:40 Error  System Account

Approval Workflow failed to run.

Last run:   25/04/2008 06:01  

Status:   In Progress  

job-workflow is scheduled to run every 5 min.

Next deliverydate for workitem is set to 25/04/2008 5:00:59 PM. Internal state of work item is 8.

Internal state of Workflow (select * from workflow...) is 4098 and Status1 is 2.

This solution work on isolated production server. On isolated test server it was working. But now, the delay activity seams to failing to run.

All patches, workaround and SP has been installed. Server Win2k3 Std x64 with SP2 and all patches to .NET framework has been installed. Solution runs on WSS with SP1 for x64 proc.

thanks for any help.

Friday, April 25, 2008 6:38 AM by Jakub Gutkowski

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Hi,guys

Delay activity troubled me for a long time.Today ,I found something which cause it can't wake.

In Sharepoint Database ,there's a table named "ScheduledWorkItems",which have a column named "DeliveryDate",

it decide that the delay acivity of workflow instance whether  wake,

sometimes the wss insert a wrong time (Max Date),so that  the instance can't wake forever,when I try to changed this  value to correct time,the instance will work normally .

as discussed above ,dealy activity  whether be  waked due to whether the time be inserted  corrected.

btw,I found that when a workflow  have parellel   delay activity , wss just  insert a record to  table of "ScheduledWorkItems", which make me confused.

do you have any suggestion?   share  it with us please.

Wednesday, April 30, 2008 5:21 AM by TomGang

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Restart the SPTimerV3 service after deploying a revised workflow DLL that uses DelayActivities.  Is seems the old DLL is cached by that timer service (shame on you Microsoft!!!) and the act of installing the WSP containing the workflow feature doesn't automatically refresh all the cached copies of the DLL with the new one (more shame on Microsoft!!!).  I have a workflow now in production that relies on DelayActivities of both short-duration (5 minutes, the minimum "effective" internval you can use without changing the SP defaults) and long-term DelayActivities (initial reminder date, initial due date, contingency reminder date, contingency due date) that need to pop days/weeks/months from the point at which the workflow begins.  This particular workflow is 10,000 lines of C# code, not SPD or 3rd-part (Nintex), so "your mileage may vary".

Thursday, May 08, 2008 9:18 AM by Fred Morrison

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Recent results from testing of turning off SPTimerV3 service for extended period of time (e.g., long maintenance cycle on the server) after workflow with DelayActivities has already started running:

1. Started workflow and waited for first of five DelayActivities to "pop" (timer event delivered to the workflow).

2. Stopped (not Restart) SPTimerV3 service.

3. Deliberately kept SPTimerV3 off the air for a period of time that guaranteed that two other DelayActivities in previously started workflow that should have "popped" did not pop because the timer service was off the air and therefore not available to deliver the event at the "DeliveryDate" specified in SQL Server table ScheduledWorkItems (adjusted for UTC).

4. Started SPTimerV3 before last two DelayActivities in my particular workflow were scheduled to "pop".

Questions to be answered by the test:

1. If SPTimerV3 service is off the air, are "missed" DelayActivity timers discarded, queued, or something else?

2. If missed timers are queued waiting for SPTimerV3 to come back on the air, what order are they delivered in?

3. If missed timers are queued, are they all delivered at once or are they "spaced apart" at some interval (5 minutes perhaps)?

Results:

1. After starting the SPTimerV3 service, the two seemingly "missed" timers associated with a couple of DelayActivities in my workflow "popped" at the next opportunity (next 5 minute interval boundary since my settings are the default).

2.   The order of the missed timers was preserved, but they were delivered "in the same bundle".

3. Both missed DelayActivity timers were delivered (late by design of my test) to the workflow by the SPTimerV3 timer service and the logic behind those DelayActivities kicked in.

4. All remaining timers associated with DelayActivities "popped" when they should.

Conclusion:

Keeping SPTimerV3 service off the air for and extended period of time, such as a long maintenance window (e.g., installing SQL Server 2005 post-SP2 HotFix Rollup #7) only delays delivery of timer events associated with DelayActivities in running workflows.  Yes, it's like a multi-vehicle "pile up" when they finally do get delivered and it's difficult to pin down exactly WHEN they'll be delivered, so depending on the business process your workflow models, you'll have to decide if this "late delivery pile up" is a good thing or a bad thing.

Thursday, May 08, 2008 9:40 AM by Fred Morrison

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Error in persisting workflow: System.ArgumentOutOfRangeException

The above occurs when I start five instances of a custom workflow that contains several parallel DelayActivities (in a ConditionedActivityGroup).

The SharePoint logs have a stack trace that does not point to anything in my code, so the preliminary take is that SharePoint has serious scalability issues when it comes to running multpile, concurrent instances of a custom workflow.

I can run up to two of the workflows at a time with no issues, but the minute I try to start three or more (I usually load test with five), two or three of the five become "stuck" and have to be terminated, sometimes after several days of running.

I have an open (since early June) with Microsoft and will post the resolution once there is one to post.

Tuesday, July 01, 2008 8:59 AM by Frederick Morrison

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Has this been fixed yet?  It has been half a year since this blog was started but I still have workflows that will not dehydrate.

Tuesday, July 15, 2008 6:21 PM by Christopher Dud3en

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

The 2008-07-15 hotfixes for WSS 3.0 and MOSS 2007 do not fix all the issues I am having with the DelayActivity.   They help, but are not a 100% cure.  I am looking forward to the next set of hotfixes.

Wednesday, July 16, 2008 4:27 PM by Fred Morrison

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Fred,

What hotfixes are you referring to?  Where are they located?

Friday, July 18, 2008 1:04 PM by Christopher Duden

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I would think that after 6 months of our help that this problem would be non-existent.  My two-year old niece can tell time better than SharePoint can.  Please help us so we can help you!

Tuesday, July 22, 2008 12:27 PM by K Rock

# SPBookReport: English Curry SharePoint Best Practices, Chapter 10

Body: I just got a copy of &quot;Microsoft Office SharePoint Server 2007 Best Practices&quot; by &quot;Ben

Tuesday, August 05, 2008 10:47 AM by Mirrored Blogs

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

Hi all,

I have a workflow (with a delay activity in it) that was working fine for the longest time in my single-server dev environment. When we deployed it into our multi-server QA environment(1 front end, 1 app server, 1 db - all separate virtualized environments), the workflows started to take a really long time to complete. The workflows would appear to be "stuck" afte hitting the delay activity.

Following some of the tips in this thread, I started to poke around the database tables (ScheduledWorkItems, Workflow) to see if there was anything weird about the "stuck" workflows.

The workflows seem to go through internal states in this order: 5122 -> 4099 -> 4098 -> 4

But it can take as long as three hours to get all the way through.

I am assuming that the internal state values are from the SPWorkflowState enum, which would (I think) mean that:

5122 = All, Running, Has New Events

4099 = All, Running, Locked

4098 = All, Running,

4 = Completed

Not sure what the heck "All" means in this context, but this is what I am seeing.

Because the workflows are tied into the item update - and we have timer jobs that update lists on a periodic basis - we often have 20+ workflow instances running at the same time. In the dev environment, everything completes within a reasonable time (a couple of minutes).

Monday, August 18, 2008 7:04 PM by H.Y.

# re: Issues with the “Delay” activity in SharePoint workflows - we need your help!

I think we figured it out. At least for this specific problem (the "stuck" workflows taking a long time to resume). It turns out that in some environments, .NET 3.0 SP1 was not installed. Once I installed the service pack, things seemed to work properly. Still need to verify this in a couple other environments, but (fingers crossed) hopefully this has resolved our issue.

Wednesday, August 20, 2008 3:05 PM by H.Y.

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker