Workflows in CRM 2013
In CRM 2013 we can create synchronous (real time) workflow.
Go to Processes à New Processs à Select Category as Worfklow
Make sure that the "Run this workflow in the background (recommended) checkbox is unchecked else it would create an asynchronous workflow.
Another new feature that we have in CRM 2013 is the Execute as option.
We can choose whether we want the workflow to run in the context of the Owner of the workflow or to the user who triggered it.
For understanding the workflow context in CRM 2011, check this post
Similar to pre post event in plugin we now have Start When option, in which we can choose the workflow to run After or Before a particular event.
Let us take a simple example
Here if the contact's role is Influencer and if the user tries to Deactivate the record, we will cancel the operation.
After publishing the workflow if we want to deactivate the contact record where role is set to Influencer, we will get the following error
i.e. ISV code aborted the operation and the event will be cancelled.
Now if we want to convert this synchronous workflow to asynchronous, we can deactivate the workflow the active workflow and we will get the following option
Similarly if we have created an Asynchronous workflow, we can convert it to synchronous