Taskflows > Setting taskflow step properties > Notification Task step
  

Notification Task step

A Notification Task step sends a notification to specified recipients.
You can configure the Notification Task step to send an email notification. For example, you can send an email notification to inform recipients about the number of success rows and error rows that were encountered in a Data Task step of a taskflow.
You can define properties for the Notification Task step to configure the email recipients and email content. You cannot use distribution lists in the Email To, Email Cc, and Email Bcc fields.
The following sections describe the Notification Task step properties:

General properties

In the general properties, you can specify a descriptive name for the Notification Task step.
The name can contain only alphanumeric characters, underscores (_), spaces, and Unicode characters. The name can't contain curly brackets {}, full width lowline (_), and hyphen (-).

Notification Task properties

You can configure the following Notification Task step properties:
Notification Method
The type of notification to be sent.
The value of this field is set to Email by default. You cannot edit this value. The other values are reserved for future use.
Email To
Required. The primary recipients for the email notification.
Use one of the following options to specify the value for this field:
Default is Content.
Email Cc
The recipients who need to be sent a copy of the email notification.
Use one of the following options to specify the value for this field:
Default is Content.
Email Bcc
The additional recipients who need to be sent a copy of the email notification. The recipients in the Email To and Email Cc fields will not be able to see the recipients in the Email Bcc field. If the field contains more than one recipient, the recipients will not be able to see the other recipients in the Email Bcc field.
Use one of the following options to specify the value for this field:
Default is Content.
Email Subject
A short and descriptive subject that introduces the email.
Use one of the following options to specify the value for this field:
Default is Content.
Email Content Type
The type of formatting that you want to use for the email content.
Select one of the following values:
Default is Plain Text.
Email Body
The content that you want to send in the email.
Use one of the following options to specify the value for this field:
Default is Content.

Email notification examples

You can define the content of the email body based on the number of data tasks in the taskflow to send an email notification with HTML content.

Single data task

When you use the Notification Task step for a single data task, you can enter the data task details in the email body with the source type as content.
For example, you might pass the following XQuery expression:
Hi,
Data task with Run Id { $temp.DataTask1[1]/output[1]/Run_Id } started at { $temp.DataTask1[1]/output[1]/Start_Time } and completed at { $temp.DataTask1[1]/output[1]/End_Time } with a status of { $temp.DataTask1[1]/output[1]/Task_Status }

In the above example, if the data task runs successfully, you will receive the output details in an email notification.
In case the data task fails, you can use the fault fields in the XQuery expression to determine the reason for failure as shown in the following example:
Hi,
Data task with Run Id { $temp.DataTask1[1]/fault[1]/detail[1]/errOutputDetail[1]/Run_Id } started at { $temp.DataTask1[1]/fault[1]/detail[1]/errOutputDetail[1]/Start_Time } and completed at { $temp.DataTask1[1]/fault[1]/detail[1]/errOutputDetail[1]/End_Time } with a status of { $temp.DataTask1[1]/fault[1]/detail[1]/errOutputDetail[1]/Task_Status }

Multiple data tasks

When you use the Notification Task step to send an email summary for multiple data tasks, you can use an XQuery expression with the source type as formula.
For example, you might pass the following XQuery expression for a taskflow that contains two data tasks named <DataTask1> and <DataTask2>:
util:toXML(<html>
<head><h3>Taskflow Tasks Status Summary</h3></head>
<body>
<table>
<tr>
<th>Task Name</th>
<th>Job Id</th>
<th>Status</th>
<th>Start Time</th>
<th>End Time</th>
</tr>
{
  let $dataTasks := ($temp.DataTask1, $temp.DataTask2)
for $dataTask in $dataTasks
return
<tr>
<td>{ local-name($dataTask) }</td>
<td>{ $dataTask[1]/output[1]/Run_Id }</td>
<td>{ $dataTask[1]/output[1]/Task_Status }</td>
<td>{ $dataTask[1]/output[1]/Start_Time }</td>
<td>{ $dataTask[1]/output[1]/End_Time }</td>
</tr>
}
</table>
</body>
</html>)
In the above example, if the data task runs successfully, you will receive the output details in an email notification.
In case of failed data tasks, you can use the fault fields in the XQuery expression to determine the reason for failure as shown in the following example:
util:toXML(<html>
<head><h3>Taskflow Tasks Status Summary</h3></head>
<body>
<table>
<tr>
<th>Task Name</th>
<th>Job Id</th>
<th>Status</th>
<th>Start Time</th>
<th>End Time</th>
</tr>
{
let $dataTasks := ($temp.DataTask1, $temp.DataTask2)
for $dataTask in $dataTasks
return
<tr>
<td>{ local-name($dataTask) }</td>
<td>{ $dataTask[1]/fault[1]/detail[1]/errOutputDetail[1]/Run_Id }</td>
<td>{ $dataTask[1]/fault[1]/detail[1]/errOutputDetail[1]/Task_Status }</td>
<td>{ $dataTask[1]/fault[1]/detail[1]/errOutputDetail[1]/Start_Time }</td>
<td>{ $dataTask[1]/fault[1]/detail[1]/errOutputDetail[1]/End_Time }</td>
</tr>
}
</table>
</body>
</html>)
Before sending an email notification, you might want to convert the timezone based on the recipient's location. To do this, you can use the infa:format XQuery function in the email subject or email body. For more information about converting the timezone using a formula, see the following community article:
https://knowledge.informatica.com/s/article/DOC-19342

Rules and guidelines for Notification Task step

Certain restrictions apply when you use the Content option to specify the email body and the HTML option to specify the email content type in a Notification Task step.
Consider the following guidelines: