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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Can an action invoke an asynchronous child workflow and pass its parameters to this child workflow.

(0) ShareShare
ReportReport
Posted on by

I have an action that is invoked by a sync. plugin which passes some arguments to it. I want this action to perform some work asynchronously. Currently I have the action calling a custom workflow activity, but the flow is synchronous. Would it be possible to have this action call an asynchronous child workflow instead and pass its argument values to this workflow?

Are there any other alternatives to allow a synchronous plugin to perform some work asynchronously (essentially a fire and forget scenario) via an action?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Bruno Lucas Profile Picture
    5,421 on at
    RE: Can an action invoke an asynchronous child workflow and pass its parameters to this child workflow.

    Are you trying to use C# async call on the Action or do you want to change the workflow to run Async? Sync workflows were introduced in 2013, normally they are already async.

    you can change by just ticking\unticking this option:

    blog.clickdimensions.com/.../using-real-time-synchronous-workflows-in-dynamics-crm-2013.html

    you can do it programmatically:

    Convert an asynchronous workflow to real-time and back

    You can convert workflows from asynchronous to real-time and back using UpdateRequest without the need to rewrite the workflow, as long as the asynchronous workflow doesn’t contain any wait or delay activities. You can also do the conversion interactively by using the web application. The workflow must be in a draft state (not-activated) before the conversion is performed.

    msdn.microsoft.com/.../dn481598.aspx

  • cranialsurge Profile Picture
    on at
    RE: Can an action invoke an asynchronous child workflow and pass its parameters to this child workflow.

    Thanks for your response! Currently I'm not using a workflow. I have a custom workflow activity assembly instead that gets called by the action when that action is invoked by a synchronous plugin. However the problem with a sync plugin is that if an exception is thrown in it and it is registered as a pre-op or a post-op plugin it results in the main operation getting rolled back because all of them are part of the same DB transaction.

    My objective is to be able to still create a log entity record in CRM even if a plugin exception occurs which would cause whatever work it was trying to achieve to be rolled back. I was hoping to be able to achieve this asynchronously so that the rollback of the DB transaction does not impact the creation of an error entity record.

  • Bruno Lucas Profile Picture
    5,421 on at
    RE: Can an action invoke an asynchronous child workflow and pass its parameters to this child workflow.

    Did you try to register the plugin as async? do you have functionality on that that need to run on pre-op? if not you can register to run async post-op

  • cranialsurge Profile Picture
    on at
    RE: Can an action invoke an asynchronous child workflow and pass its parameters to this child workflow.

    This is an existing plugin that needs to be sync and run pre-op.

  • Verified answer
    cranialsurge Profile Picture
    on at
    RE: Can an action invoke an asynchronous child workflow and pass its parameters to this child workflow.

    Figured it out! This post explains exactly what I was looking for along with a solution: crmtidbits.blogspot.pt/2014/02/bypass-plug-in-transaction-to-log.html

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
Wayne Walton Profile Picture

Wayne Walton 2

#2
Good.Panos Profile Picture

Good.Panos 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans