Workflow Notification Triggering Twice

gnunez
Kilo Guru

Hello all,

I normally use email notifications versus workflow notification to trigger emails, but for this catalog item I trigger a notification from the workflow to notify the requestor the request has been approved. I use this method because I need to send to multiple users in addition to "opened by" and "requested for". For some reason the emails keep triggering twice and I've noticed that this is only for the notifications triggered through the workflow and not regular email. Does someone know what may be causing this?

Thanks in advance!

Grace

6 REPLIES 6

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Does this workflow have any current.update() script statements?  Workflows by design "listen" for updates to the attached record it is running against.  If the workflow itself is performing an update via current.update() then there is a chance that another server thread may pick that up and run the context again.  When publishing the workflow it does check for this situation.  You can click the workflow editor checkbox/Validate button to see:

find_real_file.png

I don't see anything for current.update() script statements. I checked the workflow editor checkbox and see the below:

find_real_file.png

 

 

 

At the beginning of the workflow I trigger a notification (separate from the approval notification that is triggering twice) via a run script and event and I wonder if this has something to do with it? Here is my run script:

find_real_file.png

 

These are the notifications triggering more than once:

find_real_file.png

OK so you have a run script executing an event which an email notification is tied to to send a notification.  Several questions:

  • Do the duplicates contain the exact same verbiage or are they different?
  • Do your above highlighted notification activities also fire the same event?  If so that will definitely cause the duplication and those additional notification activities may not be necessary.  Behind the scenes that activity is also executing the gs.eventQueue() API.

Just as a test, unlink one of the notification activities from your flow and see if one of them is not duplicated.

Hi Michael,

Yes, but the run script triggers an email separate from the approval emails. 

To answer your questions

1. Yes, the duplicates contain the exact same verbiage. The email log shows the exact details for the duplicates.

2. The highlighted notifications are not fired by an event. The highlighted notifications are hardcoded (see below).

find_real_file.png

3. I tested using your suggestion by unlinking one of the workflow notifications but they still triggered duplicates...