Search code examples
dynamics-crm-2011dynamics-crm

which workflow runs first in Dynamics CRM 2011?


If there is more than one workflow that runs when a Record is Created or Updated in Dynamics CRM, is there any precedence on which workflows runs first over others?

For eg: if WF-A, WF-B, WF-C start when a attribute 'AAA' is updated on a Record, which one runs first? Do they run in same order every time?

Thanks for your answer!!


Solution

  • Although it is documented that you can control the order of operation of asynchronous workflows, this information is not correct as you can see here:

    https://social.microsoft.com/Forums/en-US/b0a47892-e240-4c98-9b2e-a5231fb579f1/message-ordering-and-the-asyncoperationdependencytoken?forum=crmdevelopment

    Since you are on CRM 2011, you have a few options:

    1. Do what @Sxntk mentions in his answer (create a single WF which calls the others as steps).
    2. Add delays in the WF's want to execute last. For example, add a 2 minute delay on WF 2 and a 4 minute delay on WF 3. This isn't guaranteed, but for the most part will most always work.
    3. Create the actions inside of plugin which you can execute synchronously. This requires coding so it may not be a valid option.

    Option 1 is most likely the best fit.