Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Workflow Infinite Loop Error

Status
Not open for further replies.

curtisn

Technical User
Aug 18, 2008
2
0
0
US
I have been asked to fix our workflow rules so they run faster. In 3.0 we used a Master "On Create" workflow to run a sales process. Basically an activity is scheduled, and upon completion, the account's sales stage is updated to the next stage and a new activity is created. There are 5 Sales Stages (Call 1, Research, Call 2, Call 3, and Call 3 Extended). The Call 2 stage has 2 activities that must be completed in order to advance to the Call 3 sales stage. However, it also ran many other processes simultaneously. When we upgraded to 4.0 I noticed the sales process workflow that was running on every account would get stuck in "waiting" status even after an account had been dispositioned. It would take about 24 hours or more to schedule the next activity. Since we only close sales on about 2% of our accounts we have a TON of huge master "on create" workflows that are still waiting to be completed. So in 4.0 I re-wrote a new sales stage workflow that runs whenever the sales stage attribute changes. Here’s what I did…

1. Created new child workflows for each stage: Create phone call activity; wait for completed; then update sales stage. There are 5 of them, Call 1, Pricing Research, Call 2, Call 3, and Call 3 extended. The call 2 stage consists of two activities (Call 2 is Due and Fax/Email Brochure) that must be completed before advancing to the next sales stage.

2. Created a new “On Change” workflow that watches the sales stage field on the account form: Runs on change of sales stage and calls the appropriate child workflow to run based on the sales stage. For example: if account sales stage = Pricing Research, then start child workflow “Research.”

3. Created a Sales Stage On Create to set the sales stage to Call 1 initially.

However, when I test it, everything works up until Call 3 stage. The Call 2 child workflow will complete successfully and update the sales stage to Call 3. Then the “On Change” workflow will run again, but it fails when starting the Call 3 Child workflow, and the error says “The workflow failed because the workflow that started it included an infinite loop, check the help section and fix your workflow logic.”

I’ve done some other tests, like reversed the order, and put the call 3 stage before the call 2 stage to see if the problem was with the child workflow or the “on change” one. Same problem, only the Call 3 completed successfully and failed on the Call 2 stage this time. So I’m led to believe that there is a problem with my “On Change” workflow. Another test, I took the call 3 stage out completely and workflow failed on Call 3 extended stage.

It seems to run successfully through the third sales stage (Call 1, Research, and Call 2) but always fails on the fourth stage (Call 3). And it doesn't matter which order I place the stages. For example, one of my tests yielded this result:
Call 1: Successful
Research: Successful
Call 3: Successful
Call 2: Failed

Or:

Call 1: Successful
Research: Successful
Call 2: Successful
Call 3 Extended: Failed

Any ideas what the problem is? Why is it saying there is an infinite loop?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top