Duplicate workflow triggered in [Email] module RRS feed

  • Question

  • Hi All,

      I'm having issue on controlling the workflow.  My scenario as follow:

    1) When an email is sent out from CRM, a workflow called "System - Email - Need Reply" will be triggered (based on [Email].[No. of Delivery Attempts]).  In that workflow, I had specified that if the [No. Of Delivery Attempts] = 1, then only continue to update the [Case].[Need Reply] field to "Yes".

    2) As 1 email will have at least 2 times of [No. of Delivery Attempts] changes (<null> to 0, 0 to 1), thus this workflow will be triggered twice.  My issue here is that that 2 time changes is too fast (less than a second), and cause these 2 workflows detected the same value [No. Of Delivery Attempts] = 1, and thus update the [Case].[Need Reply] field to "Yes" twice. 

            3) I had another workflow in [Case] level, and whenever there is a change of [Case].[Need Reply], system will run a custom SLA routine.  Ideally, the routine should run in 1 time only, but because of the "Point 2", it cause the system sometimes run twice on the SLA routine.

            4) I believe I had done enough extra custom field in [Case] (I added additional field called [Old Need Reply]), to ensure the routine only run 1 time, but it seems not success because of "Point 2" event.

           Is there any suggestion can be provided?  Thanks.


    Desmond Chan

    Tuesday, July 7, 2015 4:35 AM


  • Hi All,

      After 6 days of monitoring, the idea given by Henri is working perfectly fine now.

    Hi Henri,

      Thanks a lot!  You save my days!

    • Marked as answer by QLS IT Monday, July 13, 2015 4:20 AM
    Monday, July 13, 2015 4:20 AM

All replies

  • By the way, can help to verify my account as well?  I'm trying to do the attachment for this issue.  Thanks.

    Tuesday, July 7, 2015 4:36 AM
  • The choice of [No. Of Delivery Attempts] is not a good one as it is internal system field updated by Email Router. See below description of the field.

    "Shows the count of the number of attempts made to send the email. The count is used as an indicator of email routing issues."

    I would amend your workflow "System - Email - Need Reply" to execute on change of Email Status to Sent. Then, add another Check Condition to check if [Case].[Need Reply] is No, then update to Yes. Do nothing if already Need Reply is already Yes.

    Tuesday, July 7, 2015 5:06 AM
  • Hi Henri,

      Thanks.  That was the original criteria setting I tried before, and to use [No. Of Delivery Attempts] is also getting the same effect.  However, if use [Status Reason], it might be worst, as [Status Reason] will change 4 times (<null> to "Draft", "Draft" to "Pending Send", "Pending Send" to "Sending", "Sending" to "Sent"), while [No. Of Delivery Attempts] only change twice.

      Appreciate you can help to advice again.  I was stuck for weeks on that issue.

      Please click on the link to see the screenshot from my workflow (the trigger point is [No. Of Delivery Attempts] field change).  On the [Email].[Audit History], [No. Of Delivery Attempts] and [Status Reason] are both changed twice within a second (Sorry, my account still not being verified, and thus cannot post picture here).


    Tuesday, July 7, 2015 6:04 AM
  • Hi All,

      I'm reviewing the [Email] module again, and is it for every email, [Tracking Token] will be assigned, and one-and-only-one time?  If yes, what if my workflow will only being triggered upon changes on [Tracking Token], and wait until [Status Reason] = "Sent", then only update [Case].[Need Reply] field?

      Appreciate if anyone do agree with this idea, or there is any better way.


    Tuesday, July 7, 2015 8:08 AM
  • Hi QLS,

    It seems the Email Router updates the email record twice setting the 'No. of Delivery Attempts' almost at the same, therefore, triggered the workflow twice. Through SDK it is possible to 'update' a field with the same value, and this event will trigger the workflow as if the value has changed but in fact the field is updated with the same value.

    Tracking the Status Reason field value will make situation better but there is still possibility for similar scenario to occur.

    The options I could think of:

    a. Create a workflow which executes on Create only, then wait for the status to change to Sent, then continue with the remaining logic. See screenshot below. You can add additional logic, eg. checking if the Regarding is Case, etc.

    b. Use plugin to execute the workflow only if the status reason is changed to Sent.

    By the way, if I understood your business logic correctly, you should check for 'Need Reply?'=No, rather than Yes, that the 'Need Reply?' field will be set to Yes in the update Case step.



    EDIT: From the screenshot it seems you are using CRM 2011, so you don't have synchronous workflow if I remember correctly that this feature is available from version 2013. If the feature is available, then you set your workflow to track on status reason change, but run synchronously.
    • Edited by Henri_L Wednesday, July 8, 2015 12:27 AM
    Wednesday, July 8, 2015 12:22 AM
  • Hi Henri,

      Thanks for this idea.  I'm trying with your method now, and see if it will work better.  I had added additional criteria checking, so that those "incoming" email will not get involve with the workflow.

      The workflow purpose is actually just update [Case].[Need Reply] flag to "No", to indicate that our customer service team already replied the case.

      Yes, we are still using CRM 2011.  :)

      Below is the link for the amended workflow, let's see if it will solve the issue better.  Thanks again.


    Wednesday, July 8, 2015 3:09 AM
  • Hi All,

      After 6 days of monitoring, the idea given by Henri is working perfectly fine now.

    Hi Henri,

      Thanks a lot!  You save my days!

    • Marked as answer by QLS IT Monday, July 13, 2015 4:20 AM
    Monday, July 13, 2015 4:20 AM