Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Plugins run-time affecting how many times a single Workflow can run?

(0) ShareShare
ReportReport
Posted on by 120

Greetings guys, I have a requirement that has to do with field service and I've met a really strange situation.

My client wants a .doc file to generate and attached to a bookable resource booking every time that its field "booking's status" turns to "Completed". For that I used a workflow with a SetWordTemplate action, and it works great. The status turns to "Completed" and voila a single .doc file is generated and attaches to the booking. Perfect.

Now, I have to say that besides that workflow, the field "booking status" update triggers a (synchronous) plugin as well. Moreover we have several plugins running on updates of different fields of the booking other than the status (let's say that one of them is the field "Return Time"). When the user fills the "Return Time" field with a value, sets the booking status to "completed" and saves the entity, two plugins are running on the background. It takes some time but they do their work as planned. However, to my unwelcome surprise, when they complete, there are several identical.doc files attached to the booking. The worfklow is supposed to run only once though, and it seems the delay of the plugins run have caused the flow to run multiple times. Now if I update only the "Return Time" field and save, then update the booking status to complete and save, only one .doc is generated. Any idea why is this happening and how I can face it?

PS: The plugins do not update the field booking status somewhere, there's no loop.

  • Fubar Profile Picture
    2,752 on at
    RE: Plugins run-time affecting how many times a single Workflow can run?

    You mention the word flow in you description Is it s Flow or a Workflow? (a flow would trigger on any update)

    Look at the audit history to see if there are multiple updates showing the field in question (your plugins may have an update transaction that includes the field in question as part of the transaction even though the value does not change it would still trigger as an update on the field as the field is part of the update).

    You may need to implement a flag or date field that you update to indicate that the process has already run and then check that field in your flow/workflow.

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at
    RE: Plugins run-time affecting how many times a single Workflow can run?

    Hi,

    Can you please check if your plugins perform an update directely on the target entity.

    You can also play with the execution order. In fact, you can avoid simultaneous executions between your plugins.

    The delay is not the problem.

  • Suggested answer
    Joseph McGregor Macdonald Profile Picture
    597 on at
    RE: Plugins run-time affecting how many times a single Workflow can run?

    Hi Giannis

    I have experienced similar issues when workflows run asynchronously. My general approach for this problem is to trigger the workflow/process in a plugin, because in plugins you can explicitly check if the state has changed to completed for the current event by inspecting both the preimage and the changing fields

    While this does mean the process is not entirely configurable in the UI, it means less chance of missed or duplicate executions of the 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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

#3
Eugen Podkorytov Profile Picture

Eugen Podkorytov 102

Overall leaderboard

Product updates

Dynamics 365 release plans