Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Adrian Begovich's Blog / Asynchronous Background Wor...

Asynchronous Background Workflows & Synchronous Real-time Workflows

Adrian Begovich Profile Picture Adrian Begovich 1,025 Super User 2025 Season 1

There is an option to enable the Run this workflow in the background (recommended) setting when developing a workflow in Dynamics 365. Enabling this setting results in an asynchronous background workflow, and if this setting is disabled a synchronous real-time workflow will be created instead. It is important to compare the potential delay of running an asynchronous background workflow against any possible impacts to performance caused by running a synchronous real-time workflow.


An asynchronous service handles the execution of asynchronous background workflows. Asynchronous workflow operations must wait for their turn in a managed queue and can only execute when the asynchronous service processes its queue. The execution time is often very quick, but there is no guarantee that it will be. The benefit of an asynchronous background workflow is that a user does not need to wait for the workflow to finish executing.

Asynchronous-Background-Workflow.png


Synchronous real-time workflows are different to asynchronous background workflows in that they execute immediately without having to wait for a managed queue to process the operations. Instead, the web server resources utilised by the current user’s session process the operations immediately. Users must wait for synchronous real-time workflows to finish execution as they start immediately and run until completion.

Synchronous-Real_2D00_time-Workflows.png


I recommend using synchronous real-time workflows when the performance impact of executing the business logic is negligible, or the change needs to be instantly visible. Asynchronous background workflows are best when the workflow logic involves high volume tasks that are not time critical such as sending emails or certain CRUD operations. In addition, asynchronous background workflows allow for wait conditions that are not available for synchronous real-time workflows, so if wait conditions are required then asynchronous background workflows are the only option. As long as you do not use those wait conditions, you can convert asynchronous background workflows to synchronous real-time workflows and vice versa by clicking the Convert to a real-time workflow or Convert to a background workflow button.

Comments

*This post is locked for comments