Skip main navigation

Workflows and Other Automations

.

In the previous step, you learnt about workflow waiting, parallel wait, stopping, URL’s and child workflows. These will assist you in setting up workflows with automation more effectively.

When building automation including workflows, you need to take into consideration other automation (business rules, Microsoft Flows, developer logic) that already exist or will be built.

Each type of automation that the Power Platform offers implements some forms of protection or features that try to minimise the ability for one automation to impact another. The project team is ultimately responsible for ensuring the automation they build is compatible.

Within a workflow, performing the same operation that is configured as a workflow trigger may cause an infinite loop. For example, updating the target account record in a workflow that is triggered by an account update event, may result in a workflow triggering itself and causing the loop. To prevent these loops, the system will terminate any workflows looping more than 15 times within an hour.

Circular dependencies are often indirect. Other automations like plug-ins, business rules, and Flows can trigger events that cause workflows to execute. On the other hand, workflows can generate events that will trigger other automation processes including workflows themselves. Without consideration and coordination on your project, this back and forth triggering can lead to deadlocks (which can lead to timeout/failure of user actions) and poor performance.

A good way to avoid unnecessary triggering and loops is to ensure you properly set your attribute filters on the workflows, plug-ins and Microsoft Flows when configuring update triggers.

Screenshot of fields to select

Another technique that causes excessive triggering of workflows and other processes is updating too many fields. It’s important to remember that any update will fire a field change trigger even if the value hasn’t changed but has been specified on an update request. Always ensure that for any update you only specify the fields that have actual changed values.

Impact of Multiple Workflows or Plugins

When you have multiple real-time workflows and/or plug-ins that run for the same triggering event they all must succeed, or all fail, and the changes will be undone. If you are building a real-time workflow and use the Stop Workflow option providing an error remember this can terminate all work being done and stop the create or update request from completing. Always consider if possible creating a task for someone to follow up with a resolution is a better option than simply terminating the work.

Background workflows run independently from other workflows and plug-ins. Their execution order and time of completion is not guaranteed and will in most cases happen after the user already gets the response to their create or update request.

Running more than one workflow that updates the same entity can cause resource locking issues. A good practice to avoid potential locks is to limit the number of workflows that update the same entity.

By coordinating with your project’s solution architect, you can ensure the workflow automation being built will be compatible with other automation and do not cause deadlocks or performance issues.

This article is from the free online

Dynamics 365: Working with Power Platform Automation

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now