Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Workflow fires several times on business process automation

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

  • Maxim1384 Profile Picture
    Maxim1384 15 on at
    RE: Workflow fires several times on business process automation

    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.

  • BharatPremji Profile Picture
    BharatPremji 2,485 on at
    RE: Workflow fires several times on business process automation

    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

  • Hugo G. Morillo Profile Picture
    Hugo G. Morillo 75 on at
    RE: Workflow fires several times on business process automation

    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.

  • Suggested answer
    BharatPremji Profile Picture
    BharatPremji 2,485 on at
    RE: Workflow fires several times on business process automation

    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

  • Suggested answer
    SCV Profile Picture
    SCV 1,004 on at
    RE: Workflow fires several times on business process automation

    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.

  • Hugo G. Morillo Profile Picture
    Hugo G. Morillo 75 on at
    RE: Workflow fires several times on business process automation

    Can you explain that with a little example?

    Thank you.

  • Suggested answer
    SCV Profile Picture
    SCV 1,004 on at
    RE: Workflow fires several times on business process automation

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans