Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archive)
Answered

Plugins that triggered from SLA Workflow throws Infinite Loop Error but there is no loop

(0) ShareShare
ReportReport
Posted on by 535

Hi,

To summarize the process : 

One of our clients environment we have SLA on a custom activity entity. When an incident created, we create its activity then sla step begins.

After its time expired, SLA workflow tries to update the field "Expired", then on the update of "Expired" field another async workflow triggers and update the record statuscode. We have 3 different plugins that trigger on this entitiy statuscode changes. These plugins do different things but one of them updates back Incident level so another task gets created and new SLA starts for this task. This goes on depends how many sla steps there are. The 3 plugins that triggers on statuscode are at same level. Another plugin that triggers when Incident Sla level updated is a child plugin and it creates a new task as i mentioned.

Error:

On this custom incident task entity, When the first step begins and after its expired, SLA Workflow tries to update as Expired. But it can't because plugins throw exception of infinite loop. But when i try to update this "Expired" field as manually from form, everything works as good. So i debugged it, when these plugins triggered from SLA wf, they come as depth 8. If i update from form, it comes as depth 2. I changed MaximumDepth from 8 to 15 to observe. Now most of them works fine but there is still infinite loop errors happen. If something stuck in loop, same things should happen when i update this field on the form. What should i check or do you have any idea why is this happening?

  • furkank Profile Picture
    535 on at
    RE: Plugins that triggered from SLA Workflow throws Infinite Loop Error but there is no loop

    Where do we mark the thread as verified?

  • Suggested answer
    Bipin D365 Profile Picture
    28,958 Moderator on at
    RE: Plugins that triggered from SLA Workflow throws Infinite Loop Error but there is no loop

    Hi,

    If your problem is solved. Please mark this thread verified so that it will be helpful for other community member. 

    If found helpful, Please mark my answer verified.

  • Verified answer
    furkank Profile Picture
    535 on at
    RE: Plugins that triggered from SLA Workflow throws Infinite Loop Error but there is no loop

    the problem solved after restarted backend and SQL servers, sandbox services. I think some of the services used Max depth as 8, thats why sometimes this problem occured. Thanks everyone.

  • Suggested answer
    Johao Larios Profile Picture
    1,795 on at
    RE: Plugins that triggered from SLA Workflow throws Infinite Loop Error but there is no loop

    Hello Furkank,

    Thanks so much for the information, my recommendation for this scenario is to open a ticket with Microsoft Support since this seems to be something that would require a deep investigation.

    Regards ,

  • furkank Profile Picture
    535 on at
    RE: Plugins that triggered from SLA Workflow throws Infinite Loop Error but there is no loop

    hi,

    Since this problem solved for %80 of the records when i increased the depth 8 to 15, it looks like not there is actually a loop. For some reason if workflow changes the field initial plugin start with depth 8. I am trying to find that. Thats why i dont want to change the process the way it runs.

    When i check trace logs there is not a plugin runs over and over again.

  • furkank Profile Picture
    535 on at
    RE: Plugins that triggered from SLA Workflow throws Infinite Loop Error but there is no loop

    Hi,

    I created a workflow that works on demand just to set "Expired" to yes on records that SLA Workflows occurs errors. So while im trying to solve the problem, the proccess can continue. I automated it to work on in every couple minutes. I filter the records and run this workflow. And i realized the source of error not sla workflows. Same error occurs while if i try to use this workflow. It works on demand updates only "Expired" field. On the same records if i dont use workflow and update the field from the form i see initial triggered plugins depth 2 , if i use workflow i see inital depth 8. There is only 1 workflow triggers after i set Expired. It changes status code. My plugins business logic seems fine. One is updating the sla level on incident others validating the process. It don't seems logical to me but i am trying to understand why depth is increasing

  • Suggested answer
    Malini Johari Profile Picture
    160 on at
    RE: Plugins that triggered from SLA Workflow throws Infinite Loop Error but there is no loop

    Hi,

    I would suggest you to check SLA Detail and criteria. It mostly goes in loop because of criteria mentioned in that particular SLA.  Can hit and try by removing any criteria or sla detail.

    Also would suggest you to manage your business logic in such a way that particular plugin will trigger on appropriate action only. you can set any flag along with Status change.

    Thanks 

  • Suggested answer
    Johao Larios Profile Picture
    1,795 on at
    RE: Plugins that triggered from SLA Workflow throws Infinite Loop Error but there is no loop

    hi,

    I recommend you a couple of things.

    -First, validate you are using latest available SDK .dlls version.

    -Check this link docs.microsoft.com/.../limit-registration-plugins-retrieve-retrievemultiple

    -Add more conditions on your plugins/workflows so then get the logic executed only under specific scenarios.

    -Validate the execution order of your plugins.

    -Try to explore another options like power automate, javascript of busines rules for this process.

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

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283,860 Test role Public

#2
Ludwig Reinhard Profile Picture

Ludwig Reinhard Microsoft Employee

#3
Martin Dráb Profile Picture

Martin Dráb 225,155 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans