Automic Workload Automation

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

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

    Posted Aug 15, 2016 05:53 PM
    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.jpghttps://us.v-cdn.net/5019921/uploads/editor/1o/hfci9era3b3p.jpg" width="782">

    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.jpghttps://us.v-cdn.net/5019921/uploads/editor/d3/n37mbrqyyhrk.jpg" width="970">

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

    rtb2cf7poxw1.jpghttps://us.v-cdn.net/5019921/uploads/editor/1j/rtb2cf7poxw1.jpg" width="976">

    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.jpghttps://us.v-cdn.net/5019921/uploads/editor/md/w6q6tf55x69l.jpg" width="723">

    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.jpghttps://us.v-cdn.net/5019921/uploads/editor/l7/dct0jwe9e3q2.jpg" width="746">

    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.