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)

Workflow fires several times on business process automation

(0) ShareShare
ReportReport
Posted on by 75

Hello everyone! Hope you're well.

I've created a workflow in a BPF entity, and the trigger is the change of the active stage. Using that, I've created a business process automation, with jumps forward and backward, as long as the stage is on the traversed path. I need to, when a specific stage is the active stage, create a child incident (the BPF is on the incident entity) with diferents parameters.

The workflow has no problems with the jumps, or assign incident to a team, but when a try to create the child incident it fires 3 times (maybe more). So it creates 3 child incidents. I've checked no other workflow or plugin is on the same event. 

CRM Version: Microsoft Dynamics 365 version 1612 (8.2.2.112) On Premise

Thanks in advance!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    SCV Profile Picture
    1,004 on at

    I guess your workflow is going through an infinite loop. When the new child incident created the workflow triggers and then again and again. CRM recognizes this and stops the loop; that's why you get only 3 records or a bit more without creating a lot. When a new child incident gets created probably the active stage changes and this causes the infinite loop I believe. Add extra condition (e.g. created on is more than a minute ago or so) before creating a child record which will stop the loop.

  • Hugo G. Morillo Profile Picture
    75 on at

    Can you explain that with a little example?

    Thank you.

  • Suggested answer
    SCV Profile Picture
    1,004 on at

    Try below for troubleshooting:

    Enable auditing for the incident entity. (especially process stage field as this is the field which trigger the workflow)

    Uncheck the checkbox which tells the system to delete the successful workflow instances.

    Then you perform your activity and check the created incident records' audit log and workflow instances (system jobs). If you see any workflow instances for the child records we can confirm that above is the case.

  • Suggested answer
    BharatPremji Profile Picture
    2,485 on at

    Hi Hugo,

    Do you have 3 stages in the BPF?

    We have seen this behavior before where if the workflow is set to fire on the entry or exit of a BPF stage it fires the same number of times as there are stages in the BPF.

    We got round this by adding a boolean field to the BPF and triggering the workflow from that.

    I'm pretty sure this has been fixed in the Online version now

    Regards

    Bharat

  • Hugo G. Morillo Profile Picture
    75 on at

    Yeah, I think so (it fires same number of times as there are stages in the BPF)

    You've created this boolean field and automatically updated it from the entity related to the BPF, right? For example, update the boolean field on stage change event of the BPF (Javascript)

    I have a workflow that triggers on active stage change event of the BPF entity. For example, I have a BPF with 4 stages: A, B, C and D. If the active stage is B, I check some fields and automatically move forward to the C stage or D stage (depends of the conditions). So I think the problem is when I update the active stage within that workflow.

    The expected behavior is when user manually change the active stage (using BPF UI navigation), trigger the workflow, detects the active stage and do some stuff (e.g. jump forward to a next stage). If that so, it has to fire another workflow with the new active stage.

  • BharatPremji Profile Picture
    2,485 on at

    Hi Hugo,

    No, I removed the workflows from the Stage entry and Exit completely.

    The boolean field on the BPF is manually updated by user to Yes and then they can move to the Next stage (again manually)  

    Not ideal but thats the only fix we could come up with at the time

    Bharat

  • Maxim1384 Profile Picture
    15 on at

    I see a very similar issue  - I have a workflow that is firing on the change of an Active Stage of the BPF entity record.

    For whatever reason when the stage is updated through the BPF UI (i.e. "next" button of the process on the parent record) then the Active Stage field is updated only once, but if I update that Active Stage field via a WF or manually, I see in the audit log, that the field is updated 3 times.

    In my case, it causes the WF that is triggered by the stage change to run 3 times.

    Would be interested to see if someone has found a solution.

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