web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM and workflow infinity loops?

(0) ShareShare
ReportReport
Posted on by 886

Hi,

I'm struggling with some infinity loops, and don't know how to resolve it. I have a "Master" workflow on one entity (That will trigger on create), that master workflow will trigger ex. 10 child workflows to perform changes (On the same record). Some of the child workflows will set a completed flag on the record (Ex. Workflow A completed = Yes). The master workflow will wait for Workflow A completed = Yes. But today when I was testing the first child workflow A failed with:

"Unhandled Exception: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: This workflow job was canceled because the workflow that started it included an infinite loop. Correct the workflow logic and try again. For information about workflow logic, see Help."

Why are they failing? And why is the first Child Workflow A failing? Because it's failing my master workflow will stop, and wait forever...

*This post is locked for comments

I have the same question (0)
  • rskadk1 Profile Picture
    886 on at

    I have checked, the first child workflow A will only run as a child workflow (Not create, on change etc).

    I can see that child workflow A failed on a lot of the records I have created within the last hour. The question is why it's failing sometimes, when the logic is exactly the same on the record? (On the master workflow)

  • Suggested answer
    razdynamics Profile Picture
    17,308 User Group Leader on at

    Hi, Your Workflow Conditions need to be corrected to prevent Infinite / suspended workflows and ensure your observing the following;

    • Refine Use Of IF Conditions

    • Include check / Validation Condition for missing objects causing infinite loop

    • Consider adding an End Workflow Statement to force WF to end if conditions are not met

    Best Wishes, Raz

  • rskadk1 Profile Picture
    886 on at

    Hi Raz,

    Thanks for your answer.

    Do you mind explain a little further regarding what you mean by:

    1) "for missing objects causing infinite loop" - how can this cause infinity loop?

    2) Consider adding an End Workflow Statement to force WF to end if conditions are not met?

    I'm pretty sure that there is nothing wrong with my conditions. Since it sometimes fails and sometimes it doesn't? (I'm doing exactly the same). Is there any limitations that a specific workflow can only run xx times? (Ex. if I create 10 records, and workflow A is launched on all  10 records at the same time, or with 10 seconds delay, since it approx. take me 10 sec to create a record..)

  • Suggested answer
    razdynamics Profile Picture
    17,308 User Group Leader on at

    Are you able to share a screenshot of your WF?

  • rskadk1 Profile Picture
    886 on at

    Yes I will upload it. Are you able to comment on the purposes you made earlier?

  • rskadk1 Profile Picture
    886 on at

    This is the master (I filtered out the company name with red marking)

    5141.Child.PNG

    And the child.

    5141.Child.PNG

    The child failed with infinity message, leading to the master could not proceed. (Marked on the master with the bracket)

  • rskadk1 Profile Picture
    886 on at

    I played some more around with it, and simplified the first step, so the first stage will update 1 field on the record. The master workflow is running on create. As you can see I got the message "This workflow job was canceled because the workflow that started it included an infinite loop. Correct the workflow logic and try again. For information about workflow logic, see Help."

    I really don't understand? How can it fail in this scenario?

    workflow-fail.PNG

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans