1

For some reason my workflow (Workflow A) designed in SPD to start when a new item is created does not start when a new item is created in another SPD workflow using the "Create List Item" action.

My scenario is:*

Workflow A - configured to start when a new item is created in List A: Creates a new list item in List B.

Workflow B - configured to start when a new item is created in List B: Creates a new list item in List A

When I test this i get the following:

I manually create a list item in List A.
Workflow A fires and creates a new list item in List B.
Workflow B fires and creates a new list item in List A.
But Workflow A does not fire on the new item in List A.

---edit----- Is this happening because the item created in List A by Workflow B is created by System Account thus not firing Workflow A?

I think ----------------edit-----------------------------------

I am aware this is causes an infinite loop there is a pause for duration action set to 1 year in workflow A. So it fires in yearly cycles.

I know sp2 prevents infinite loops being created on the same list but from what i read of the article below suggests this is possible to do cross lists as in my scenario. Link

4 Answers 4

1

you can create an infinate loop on the same list, if you like. Just use two workflows (firing on create and edit) on a list with one yes or no field (defaulted to No, or Yes - shouldnt matter in this case) that the workflows can toggle back and fourth to trigger eachother.

Workflow One action: wait for yes/no field to equal Yes and then Set field value of yes/no field to No

Workflow Two action: wait for yes/no field to equal No and then Set field value of yes/no field to Yes

This should cause an infinate loop on a list item using 2 workflows that trigger eachother back and fourth. You can also do this in a more controlled way by adding a counter that adds to itself with each loop so that after 30 loops, the counter will equal 30, after 40 loops, counter equals 40, etc... You can then set a workflow condition that stops the back and fourth triggering at Count = X

A lot more ways to get creative with this, but you can loop a workflow in sharepoint just like any language.

2

I'd hate to point out the obvious but I'm assuming there's a reasoning behind your logic:

That will start an infinite loop, you realise?

5
  • Fair point its an infinite loops I want :)
    – nav
    Nov 16, 2010 at 21:12
  • edited question with explaination
    – nav
    Nov 16, 2010 at 21:21
  • Is Sharepoint clever enough (I'm hoping not) to detect and prevent this?
    – nav
    Nov 16, 2010 at 21:25
  • I don't think it is to be honest (though others here might know more) - have you had a look at the Workflow History List to see if there's any info on what's happening, if anything at all? If you have access o the ULS Log there also might be some clues as to why the Workflow A is refusing to start the second time...
    – James Love
    Nov 16, 2010 at 21:51
  • Thanks - since the workflow doesn't start there is no workflow history but I can confirm the item is created but the workflow doesnt start. I checked the ULS logs but there are no error or information i can decipher from it.
    – nav
    Nov 16, 2010 at 22:09
0

Have you tried mixing things up a bit and manually creating the first item in List B to see if it still stops at the same point?

0

Or u can start the WorkFlow dynamicly, since SPD 2010 workflows have a kind of security which will prevent infinite loops.

Add an event receiver (item added) and start the workflow there.

I am guessing this will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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