Harriet_Kim_1764

[Quick Tips] How to Set Up Email Notification for when Tasks in a Workflow Fail or Succeed

Discussion created by Harriet_Kim_1764 on Aug 15, 2016
Scenario:

You want to receive e-mail notifications on the workflow's task status (both fail and success) along with their reports attached.

Procedure:

1. Create a workflow
2. Create a job
3. Create a call mail notification job

In this example, I created a workflow with two jobs (or tasks):

fd25cgqhxtm1.jpg

4. Edit the workflow
5. Right-click on the first task and click on 'Task Properties'

hfci9era3b3p.jpg

6. In the Postconditions tab, click and drag the 'STATUS' condition to the Conditions window
7. Configure it for 'ANY_OK', which will cover three statuses (Ended Inactive, Ended Skip because of Calendar, Ended OK). 

n37mbrqyyhrk.jpg

8. Next, go to the Actions tab and click and drag the 'EXECUTE OBJECT' to the Conditions window

rtb2cf7poxw1.jpg

9. Configure it to call your Mail notification object that you created in step 3 and set it to 'wait' (this means it will wait for the workflow to end before it sends out the e-mail notification). 

Note:  For the mail notification object, I just used the default settings to attach the task's job reports.

w6q6tf55x69l.jpg

10. Click 'Apply' or 'OK' to save.

11. Now 'Execute' your workflow to test the set-up.

In this example, my first task is configured to end normally while my 2nd task is configured to fail so that I can test if I get e-mail notifications for both statuses:

hhbvyqmka1ol.jpg

Result:

First task succeeded, this is the e-mail notification with job reports attached -

dct0jwe9e3q2.jpg

Second task failed, this is the e-mail notification with job reports attached - 

3zz8eqjelwca.jpg

Feel free to customize this set-up to any way you'd like that would best meet your business needs.  I hope this will give you an idea how to get started.

Outcomes