Welcome to MSDN Blogs Sign in | Join | Help

Tech Tips, Comments and Curious Stuff

Information surrounding technologies that I work with at Microsoft (Dynamics CRM)
Plug-in or Workflow?

With the CRM 4.0 enhancements to the plug-in and workflow engine as well as the introduction of the web based workflow designer I've seen many CRM developers asking the same question: When should I use workflow vs. plug-ins?   The answer is “depends”; the right approach is determined by the characteristics of the task that you are trying to accomplish.  The following matrix gives you my take on this:

Requirement

Plug-in

Workflow

Needs a synchronous action to happen before or after an event occurs

x

 

The same piece of logic will be executed for different events and possibly on different entities

x

x

The logic needs to be executed while offline

x

 

Needs elevation of privileges (impersonation)

x

 

Needs to execute on events other than assign, create, update, setstate

x

 

The process/logic may take a long time to complete or will be a persistent process (multiple long running steps)

 

x

Needs an asynchronous action

x

x

End users will need to modify the process logic

 

x

Child sub processes will be triggered

 

x

It may also be the case that a combination of both approaches is required; a plug-in can trigger a workflow and a vice versa.  From the above matrix the most decisive factor is whether you need a synchronous action or not; if you do, plug-ins are the way to go, if you don’t then other factors need to be pondered.

Posted: Wednesday, April 02, 2008 6:39 PM by humlezg

Comments

Catherine said:

I was looking for a matrix that defined the decisions behind when to choose a plugin over a workflow well - this is perfect! Thank you :D

Catherine Eibner

http://blog.cybner.com.au

# April 14, 2008 2:20 AM

Anne Stanton said:

Nice job! Thanks for sharing.

Cheers The CRM Lady

Anne Stanton

# April 21, 2008 3:32 PM

David Jennaway said:

I've added a similar comparison between workflows and plugins on my blog, including consideration of custom workflow activities. This can be found here:

http://mscrmuk.blogspot.com/2008/06/differences-between-workflow-and.html

# June 4, 2008 5:28 AM

Microsoft Dynamics CRM Team Blog said:

Deciding when to use a workflow vs. a plug-in is usually a straight forward process. In general, I always

# June 27, 2008 12:38 PM

Microsoft Dynamics CRM Team Blog said:

Deciding when to use a workflow vs. a plug-in is usually a straight forward process. In general, I always

# June 27, 2008 12:50 PM

Microsoft Dynamics CRM Team Blog said:

Deciding when to use a workflow vs. a plug-in is usually a straight forward process. In general, I always

# June 27, 2008 1:06 PM

Barry Givens said:

One other requirement that might be added is "The logic needs to query CRM or another system" that is, any time the action needs to find another record or records and take some action on them a plug-in is needed.

# June 30, 2008 1:49 PM

humlezg said:

Barry,

You can also create custom workflow assemblies to query external systems, so workflow would still be an option.

# July 1, 2008 12:17 PM

Vijay Jaiswal said:

I need to know, is it possible to modify business functionality logic of CRM 4.0 with Plug-ins / Work flow.

# September 1, 2008 9:34 AM

humlezg said:

Vinjay,

That is the whole point :).   Yes, i ngeneral, you can modify or construct new business logic using plug-ins or workflows.

# September 1, 2008 11:35 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker