Home » SharepointRSS

SharePoint Designer 2010 workflows do not always trigger automatically

Hi,

I have been experiencing issues with the "Start workflow automatically when an item is created" functionality I can enable in SharePoint Designer.

I first add a new item to a list (List A), and the associated workflow is triggered.

After processing this item for a few steps, the workflow creates a copy of the item (using the Copy item in ___ to ____ functionality) in another list (List B) I had previously created. It then deletes the current item (Delete item in ______), and ends.

The List B also has a workflow associated with it. When the new item is created (copied in), it triggers this second workflow. After processing some more, it (in certain cases) goes and returns the item to List A in the same way (Copy item, Delete item).

Sometimes, this does not retrigger the workflow for List A. I'd say about 50% of the time. I am unable to determine the cause of this. It's not to do with whether the item has been changed, the number of items in the list, or other workflows running at the time. 

 

Does anyone have an explanation for this behavior? How can I stop this from happening, or somehow work past it?

 

EDIT: A thought - I know SP workflows will not automatically start if the item is copied into the list by the System Account. Is it possible that while I am initially creating the workflow using non-system rights, the System Account is taking ownership somewhere along the way? I am not using any impersonation steps. 

 

 

 

3 Answers Found

 

Answer 1

I actually have successfully created the looping functionality on at least two projects that I have worked on. I will explain:
I essentially (as several Posts will state), have created "two" workflows  that are exactly the same that fire off of each other based on:
start this workflow when an item is changed or added. The way that I stop the workflows from going into an infinite loop is to set up a column on my list item that flags the record to to say that a certain condition has been met, so stop processing the workflow. So the design of the workflow is as follows:
List A (Content Type - MyContentType), List B (Content Type - MyContentType - is a child of the content type that list A is based on for inheritance with additional fields).
List A has a column named WorkFlowVarSet, this is my flag field, it also has a counter field that controls the number of items that I want to copy to my List B
When the workflow is initialized (on add), it takes the number of items that I request to be copied to list B and looks at the numbers of Items that I requested to be copied to my child List (b) and (--) decrements the number of items requested, once the number of items have been copied to my child list decrements to 0, the workflows stop initiating and terminate.
This is the only way that I found to get looping to work with share-point designer.
Other than that, I would create a custom sequential wf with visual studio 2010 (in which you have a lot more control - and debugging as well). They have also made creating custom workflows a who lot easier to create in terms of not having to fiddle around with configuration files, its "super" easy now to deploy custom workflows to you sharepoint  site

 

 

Answer 2

LionelJones5516, How many times does the looping succesfully run?

This is what i have tested.

Create a List. Add a number column to the list and set the default to 100.

Attach 1st workflow to the list. Start when item created and item changed.

If number column is creater then 1 Subtract 1 from column number and set in variable A Update current item (set column number to variable A)

Attach 2nd workflow to the list. Start when item is changed.

If number column is creater then 1 Subtract 1 from column number and set in variable A Update current item (set column number to variable A)

When i create an item the 1st workflow starts, which will fire the second, and so on. Each time the number column is subtracted by 1, so you can monitor how many times the workflow loop will run succesfully.

Now this is where i get confused. Most of the times the loop will run 11 times (1 onadd and 10 onchange). Then i get the "AutoStart Workflow: Microsoft.SharePoint.SPException: Recursive workflows  are not permitted" in the log. But sometimes it will run longer (13 or 15 times) I have tested this with multiple farms and experienced the exact same problem. It never runs to 1.

This functionality was working in Moss 2007 Sp2. It looks like there is some limit for recursive workflows in SharePoint 2010.

So how do we disable this threshold? Anybody??

Marc

 

Answer 3

Did some futher testing. When i add a pause (of one minute) to 1st workflow it will completely run down to 1. It's no solution, since a countdown from 100 will take about an hour, but it looks like the speed in which the 1st and the 2nd workflow follow up on each other is the culprit.

Marc

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Tech Videos   |   Follow us on Twitter