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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)
Under review by Community Managers

Under review

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

Real-time vs background workflows and the database transaction

Posted on by 2

Hi all

I have a situation where I run a Real-time WorkFlow in response to the create/update of a record. Under certain circumstances, I'd like to send an email to an administrator alerting them of the situation, and then cancel the WF so that this current instance of it stays in the Process Session history for me to evaluate (I dump some tracing info into the Stop Workflow -> Cancel step).

The problem I'm having is that if I cancel the WF, the email doesn't send (I'm assuming because the create/update is rolled back as part of the transaction). So the obvious solution was to put the sending of the email into a child WF and trigger it from the current WF. 

But that DIDN'T solve it. The parent WF is best suited to run Real-time, and the child WF, regardless of whether the child WF is set to RT or Background, seems to be executing within the DB transaction of the parent WF, and the email is not created! Surely if the child is Async, it shouldn't matter if the parent is RT or Async? If the child WF is Async it should run in its own transaction and the email should be created?

I then also played with switching the parent WF to Async (which is not ideal, but I wanted to see the outcome), and found it just as confusing - this time the email created, regardless of whether the child was RT or Async!

This makes no sense to me? Can anyone explain the results below?

Parent Child  Outcome
Async  Async Email
Async  Real-time Email
Real-time Real-time No email
Real-time Async No email

Which brings me to my issue - how do I send an email from a RT WF that I want to Cancel...?

Thanks!
James

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans