Major Similarities and Differences between Workflows and Plugins

Similarities and Differences between Workflows and Plugins

In this post we will discuss Similarities and Differences between Workflows and Plugins. This will help you to strong your concepts about workflows and plugins.

Similarities

➤ Both run on server

➤ Both can run synchronous (on w3wp) or Asynchronous (on async service

➤ Both can be deployed on CRM online or on premise (except XAML WFs created in VS)

➤ Both included in solution and transferable

➤ Both can post data context to Azure service bus (Azure Aware)

Differences:

Workflow

Plugin

End user and non-developers to create process on the server.

Only done through coding by software engineers or developers.

No special security access outside of CRM needed to create workflow (for real time workflow “Activate Real-Time Process” & “execute RTWF” in security roles).

Only system admin or customizer with membership in deployment admin group can register a plugin.

Can be written & extended without coding skills (unless extended with custom workflow activity).

Needs coding and developer skills.

Integrated with Windows workflow foundation 4.

Executes with help of Dynamics 365 Event Framework.

Custom workflow activities are .NET classes which inherits CodeActivity Class.

Coded in C# as .NET assemblies, which the main class implements from IPlugin interface.

Workflow can be triggered from dialogs or actions.

Can not be triggered in CRM processes through web editor UI.

Can run as child workflow

No child plugin but they can call each other and trigger each other execution

Do not execute when offline (outlook) – Only triggered online.

Both offline and online are supported.

Works well for either short or long process with use of wait step in background workflow. Wait step is not available in real-time workflow.

If in sandbox the execution limit in 2min.

In case of infinite loop, workflow can run up to maximum 16 times before platform forcefully stops its execution by default.

In case of infinite loop, a plugin can run up to maximum 8 times before platform forcefully stops its execution by default.

Build in web editor through UI or Visual Studio

Developed in Visual Studio and does not have UI.

Can run on demand

Something needs to triggers the plugin to run.

Async workflow are queued to execute after core operation

Async plugin can execute immediately after the core operation

Background workflow only runs in the context of workflow owner.

Sync or Async can impersonate at different point during transaction

Real time workflow can be run as the owner of workflow or user who triggers it.

Sync or Async can impersonate at different point during operation

Limited trigger points: assign, attribute change, create and delete

100s of them (plugin messages)

 

Conclusion:

1. Over the new releases of the CRM (2013 and later), workflows has become more powerful.

2. Plugin offer deeper level of extensibility by tapping into CRM event execution pipeline.

3. Setting aside the differences, in lot of scenarios they can be used interchangeably.