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)

Workflows, re-assigning record and using the new assignee in the same workflow

(0) ShareShare
ReportReport
Posted on by 360

I have a workflow that fires on creation, re-assigns the record, and then sends an email to the assignee. The email "to" field is dynamically-generated from "owner", so it should reflect the fact that record was re-assigned in a previous step.

If I put no wait conditions after the re-assign step, then the email gets sent to the original assignee, not the new one, even though the record is re-assigned properly after the workflow finishes. If I put a timeout of 1 minute, it sends it to the new assignee after the timeout.

How exactly does the re-assignment work? I thought all workflow steps are always synchronous, and you can trust that a previous step has completed fully before the next one is started, but this is clearly a counter-example. This thread seems to support the fact that some asynchronicity exists. community.dynamics.com/.../102152.aspx

How can I guarantee that the re-assignment has completed without putting in unnecessarily long timeouts? I can certainly live with 1 minute, but can I be certain that that's long enough to always avoid a race condition? Do workflow stages enforce synchronicity in any way, or are they only for logical grouping?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Sneha Padwal Profile Picture
    850 on at

    Hello,

    If you have one single workflow that triggers on record creation which then assigns the record and then sends an email to the Owner of the record, it is compulsory that the workflow has to finish the first step first which is assignment and only then the Send email step can pull the Dynamic value of "OwningUser{Account" in the To field.

    A wait condition of 1 minute should be good enough before adding the Send Email step but if there are multiple workflows fired on a record creation you might face SQL DeadLock scenario too. So accordingly plan your workflow steps.

    Thanks,

    Sneha P

  • Verified answer
    ScottDurow Profile Picture
    21 on at

    If you have child workflows being called from a parent workflow these will run in parallel to each other, but workflow steps in a single workflow should in theory run in sequence since they are based on a WF sequential workflow. What I think you might be seeing is the issue that operations that change the owner of records has a degree of background security work that needs to be performed before the transaction is actually complete. With snapshot isolation (which is default for Dynamics CRM now), you might actually be reading data in the next step before the transaction has been written to the snapshot. In practice, perhaps the timeout is the best approach.

    hth,

    Scott

  • Egor Profile Picture
    360 on at

    Ok, thanks Sneha and Scott. I guess I'll leave the timeout at 1 minute and hopefully nothing falls through the cracks. I'll assume that the security work Scott mentioned is the cause. I don't have any child workflows running, so there shouldn't be any issues there.

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