Understanding workflow in Dynamics 365.
Hello Guys,
In our previous blog we have learnt about client API model in D365. Today we going to explore Workflow.
Do follow us to know more about Dynamics and Power Platform. Also if you like our blog then please comment and share this blog with your friends.
Dynamics 365 workflows consists of a series of steps and rules that serve to automate a business process. You can create workflow for both OOB tables and custom tables using OOB functionalities or by writing .NET code. Workflows can be triggered based on specific condition or can be started by manually by users. Workflow can be run either in the background(asynchronous) or can be run as real time(synchronous).
Configuring a workflow has the following major parts(in sequence)
- Configure the table on which the workflow will run.
- Configure whether the workflow will run synchronously or asynchronously.
- Configure the message(event) on after which the workflow will run.
- Configure the scope in which the workflow will run.
- Configure the stages and steps(actions) of the workflow.
When you create a workflow, you will see the option of Run this workflow in the background (recommended) which determines whether the workflow will run in real-time (synchronously) or in background (asynchronously).
Asynchronous workflows in Microsoft Dynamics 365 uses windows service to act as a host application for the workflow engine to work. This Asynchronous workflows must be running ton the Windows CRM server, otherwise the workflow won’t execute.
Real-time workflows in Dynamics 365 are also known as Synchronous workflows. These are defined using the workflow entity records and specifically designed for non developers. They execute using the Event Execution Pipeline, much like plug-ins, and they can be executed pre-operation, post-operation, or during the core operation. Also, as with plug-ins, you cannot execute a real-time workflow before the Create operation or after the Delete operation.
Real-time Workflows cancel and roll back the core platform operations.
Real-time Workflows can be converted to Asynchronous workflows and vice-versa.
However, the recommended approach is to run the workflows in the background since they use system resources as and when available. However, you can always switch back from a real-time workflow to background workflow and vice versa.
Workflows can be registered on specific events as follows:
- When a record is created.
- When a record status changes.
- When a record is assigned.
- When a record field value changes.
- When a record is deleted.
- User :- Workflow will run only on the records owned by the same user as the workflow user
- Business Unit :- Workflow will run on the records owned by the users of the business unit same as the workflow user.
- Parent Child Business Units :- Workflow will run on the records owned by the users of the business unit same as the workflow user as well as any child business units.
- Organization :- Workflow will run on records owned by any user in CRM.
Although plugins and workflows both can be used to run synchronous as well as asynchronous logic, plugins are generally preferred for synchronous logic while workflows for asynchronous logic.
Generally, to implement complex business logic plugins are preferred over workflows. Workflows are preferred when you want to achieve relatively easier functionalities such as sending email, assigning records etc.
Workflows can be created through end user and non-developers on the server where as plugins can be created through software engineer or developer only.
While creating workflows no special security access is required outside the CRM where as plugin can be registered using user who is having System Admin or System Customizer security role.
Workflows can be created without code except custom workflow where as for plugin we have to write code.
Custom workflows are .NET classes which are inheriting CodeActivity class where as Plugins are .NET classes which are inheriting IPlugin interface.
Very Nice Post. I am very happy to see this post. Such a wonderful information to share with us. I would like to share with my friends. For more information visit here
ReplyDeleteMicrosoft Certified: Dynamics 365 Sales Functional Consultant Associate
Thanks Nanfor
Delete