web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Differences Between Synchronous And Asynchronous Workflow

(0) ShareShare
ReportReport
Posted on by

Hello Friends,

Can you please tell me the differences between synchronous and asynchronous workflow.

With Regards

Praveen kumar C

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi,

    The main difference is in the name - async workflows run in the background, while synchronous workflows run and hold you up until they're complete. Async workflows are usually preferred if the task doesn't have to be done at that instant because the end user doesn't have to wait for it to run.

    Hope this helps! I'd appreciate if you'd mark this as Answering your question.

    Thanks,

     Aiden

  • Verified answer
    tw0sh3ds Profile Picture
    5,600 on at

    Hi,

    Basically if you are referring to something as "asynchronous" in software world, you are expecting that the operation will be done "behind the scenes" without interrupting the main operation. So for example, you are saving the record and that triggers asynchronous workflow. Your record is being saved, the worklfow starts. When the saving finishes, you can continue working in CRM, open other records, do some other stuff. In the meantime the workflow is running and you are not aware of that - it does not affect your work, as it is done by a background task.

    Synchronous means that next operations cannot be performed until this operation is finished. So if you save the account and the synchronous workflow is triggered, you cannot do anything before it is finished - so basically you are sure that when you have back your control over CRM, the workflow has finished it's work.

    I will give you a lifetime example: you have a workflow that sends an email when you create an Opportunity. Now you create an Opportunity

    1) Asynchronous workflow - it will start and send email within a couple of seconds or minutes after you created Opportunity, you can already start adding activities or even modify Opportunity before the mail has been sent. You do not know exactly when the mail will be send - you just know that it will be done some time after Opportunity was created

    2) Synchronous workflow - you created Opportunity without any error. The workflow must have finished it's work (if there would be an error you would have beed notified) so the email is already sent. Of course saving record in this scenario is a little bit longer, as application must not only save Opportunity but also send an email.

    Of course the main advantage of background workflows, like any other background tasks, is that they do not impact on the execution time of the operation, because they are done in the background, not in the main thread (so in CRM world, they are done by CRM Async Service, not IIS web worker process)

    Hope that is clear for you now.

  • Shubham Singh Profile Picture
    20 on at

    In both the workflow fired after the creating the opportunity or saving it...so where is the difference...please make it more clear...

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    The main difference is in the name

    1. synchronous workflows run and hold you up until they're complete - the workflow starts immediately, and the user has to wait for the workflow to be completed

    2. async workflows run in the background - the execution would not start immediately, and the user does not have to wait until the workflow completes

  • Shubham Singh Profile Picture
    20 on at

    suppose entity A has synchronous workflow that creates some record in entity B....and the same entity A has plugin that creates another record...both workflow fired after saving....so which will fired 1st? Workflow or Plugin?

  • Gopalan Bhuvanesh Profile Picture
    11,401 on at
  • Community Member Profile Picture
    on at

    Synchronous plugins are triggered straight away.  So if your plugin is triggered on the Create message, it will run directly either before (validate or Pre) the database transaction or after (post) the database transaction.  The CRM form will wait until the Synchronous plugin has finished processing before the form reloads.

    Asynchronous plugins/workflows will be triggered some time later when the CRM service has enough resources.  You don’t know when this will be triggered (usually it’s done quite quickly).  Async plugins do not slow the form reloading because it doesn’t have to wait.

  • Community Member Profile Picture
    on at

    Additionally on all above comments Sync workflow runs with IIS w3wp but Async uses CRMAsyncservice to execute the threads.

    Regards,

    VC Suresh Kumar

  • Martin Donnelly Profile Picture
    1,030 on at

    So, back to synchronous workflows:

    • if the trigger is a change to a field
    • and the operation is to set the value of another field on the current record
    • and the user is entering a new record (not yet in the database)

    is the workflow merely modifying the "InputParameters" or will it execute a create (even though the user has yet to hit [SAVE])

    Even on an update, my concern is that the workflow is running to he database every time the user fumbles around with an option set or lookup.

    tough one?

  • David Jennaway Profile Picture
    14,065 on at

    The workflow (whether synchronous or asynchronous) only runs when data is sent to the server. This will be when the user clicks 'Save', but will also happen if AutoSave is enabled.

    If you have AutoSave enabled, and a workflow that is triggered on the update of multiple fields, and the user changes several of these fields, you cannot control whether the workflow will only run once, or may run multiple times - it depends whether AutoSave happens part way through the data changes

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans