Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Issue with Modern Flow order of execution

Posted on by 125

Hi All,

We have 2 Flows that are fired when a Case is accepted.

The 1st Flow creates the team memberships when the Case is accepted.

The 2nd Flow sends email notifications when a Case is accepted.

The 2nd Flow relies on the 1st Flow because that Flow generates the team memberships so it knows who to send the email to.

The problem is that they both triggered when a Case is accepted (Case status is changed to Accepted).

So you can see the potential problem?


- The 2nd Flow could be half way from completion while the 1st Flow is still in progress OR

- The 2nd Flow completes before the 1st Flow so not all emails are sent OR

- The 1st Flow completes before the 2nd Flow is executed (the ideal scenario).

But it is not a perfect world so we end up with erratic results like no emails are sent or some emails or all emails.


So how do we fix it?

1. Make them a single Flow OR

2. Generate the team memberships before the Case is accepted

3. Delay the run of the 2nd Flow by a few milliseconds or seconds

3. Perhaps use plugins instead.


But we are stuck with Modern Flows.

Can anyone think of another way so that the 1st Flow completes first before the 2nd Flow?

Thanks

a2z

  • LuHao Profile Picture
    LuHao 40,872 on at
    RE: Issue with Modern Flow order of execution

    Hi a2z,

    The trigger for the child flow is "Manually trigger a flow", which is by design. This is not done manually by the user, but by the parent flow calling the child flow to run it.

    Also, if my answer helped you, please click Yes under "Did this answer your question?". Thanks.

  • Suggested answer
    a2z Profile Picture
    a2z 125 on at
    RE: Issue with Modern Flow order of execution

    Yep, forgot about that field trigger that can be used and yes, I have implemented using a new field trigger to order the execution of the modern flows. Not sure about invoking a child modern flow as it seems to rely on manual invocation. Thanks.

    a2z

  • Suggested answer
    LuHao Profile Picture
    LuHao 40,872 on at
    RE: Issue with Modern Flow order of execution

    Hi a2z,

    In this case we have multiple ways.

    1. Add the 2nd flow steps to the end of the 1st flow, and turn off the 2nd flow.

    2. Create a child flow that is the same as the 2nd flow.

    How to create child flows: https://docs.microsoft.com/en-us/power-automate/create-child-flows

    3. For Case entity, create a two option set field that default value is No .

    Add an "Update a record" step at the end of 1st Flow, and update the two option set field to Yes.

    Change the trigger of 2nd Flow to update the two option set field to Yes, add an "Update a record" step at the end, and update the two option set field of Case to No.

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans