Notifications
Announcements
No record found.
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
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
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.
In both the workflow fired after the creating the opportunity or saving it...so where is the difference...please make it more clear...
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
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?
Please refer the following:
alagunellaikumar.blogspot.co.uk/.../which-event-fire-first-plugin-or.html
community.dynamics.com/.../119788
msdn.microsoft.com/.../gg327941.aspx
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.
Additionally on all above comments Sync workflow runs with IIS w3wp but Async uses CRMAsyncservice to execute the threads.
Regards,
VC Suresh Kumar
So, back to synchronous workflows:
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?
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2