Antoine_Sauteron_1266

Automatically trigger an e-mail when a workflow completed

Discussion created by Antoine_Sauteron_1266 on Aug 23, 2016
It's fairly easy to send an e-mail with the Automation Engine once a workflow has finished running: all it takes is a CALL object and a few adjustments.

We'll see the method is slightly different depending on whether it ended successfully or not.

1 - Creating the notification

Pre-requisite : make sure 'SMTP_' keys have been set in UC_CLIENT_SETTINGS and that the SMTP connection works.

  • From the explorer pressggklsdw24llp.pngand choose CALL > MAIL, then hit 'Create object(s)':
prrhczbli7ub.png

  • Define one or several recipients:
m2nisrgotl5v.png

  • By default the mail triggered by the CALL object will contain the object's report as an attachment:
912qbc0cy477.png

2 - Triggering the notification

A - when the execution was unsuccessful

  • Edit the workflow and make sure the'Runtime'tab is visible:
savrs93thayj.png

  • Then from the Runtime tab, check the 'Else execute' box and hit the "..." button
8z1dmoxio591.png

to choose the notification object:

1nlxrhsqj15q.png


B - When the execution was successful

In this example we want the workflow to shoot an e-mail when it ends OK. It is a bit more complex, and can be achieved by nesting the workflow into a parent workflow.

  • Create a standard workflow:
719zzzzasnkm.png

  • Drag and drop the "child" workflow into the newly created "parent" workflow. Make sure to add connections with the line tool.
o433unxrhw31.png

  • Then click on the box at the right end of the child workflow block to open itsproperties.
cv1ydrjari42.png

  • Then go to 'Postconditions' tab:

morsrf9h2ds6.png

  • Drag and drop 'Status' from the conditions column:
j56hhx8uinio.png

  • Select'ANY_OK' from the drop-down list:
r8t4l0xfv64a.png

  • Drag and drop 'EXECUTE OBJECT' from the 'Actions' column:
plmysetzo93s.png

  • Set the object name and choose 'do not wait' then press OK.
ajocttkpor5h.png

Done!

Outcomes