Visit our new documentation site! This documentation page is no longer updated.

Workflow Notifications

Table of Contents

Introduction

Below we’ll discuss how to set up different types of notification in your workflow.

We’ll go through the following notification use cases:

  • Get notified when your workflow fails
  • Get notified when your workflow succeeds
  • Get notified when your workflow takes longer than expected

Tutorial

Workflow Failure Notification

To get an email notification when any part of your workflow fails while running on Treasure Data, add the following at the top of your workflow file.

_error:
  mail>: body.txt 
  #include body.txt file in your project files or use mail>: {data: "..Content.."} instead
  subject: this workflow failed
  to: [me@example.com]

Workflow Success Notification

To get an email every time your workflow succeeds, simply can add a final task that sends an email upon success.

+success_notification:
  mail>: body.txt 
  #include body.txt file in your project files or use mail>: {data: "..Content.."} instead
  subject: workflow succeeded!
  to: [me@example.com]

Long Running Workflow Notification

To get notified if you workflow hasn’t completed by a certain time of day, add the following at the top of your workflow file.

sla:
  # triggers this task at 02:00
  time: 09:00
  +notice:
    mail>: ...

Typically, this is used in coordination with a scheduled time. As such, if your workflow starts at 7am, you may want to get notified if it hasn’t completed by 9am.

The time zone should be set separately by adding timezone: UTC at the top of the workflow as well.

Untitled-3
In the future we will add functionality to allow the SLA time to be set as number of minutes or hours after the scheduled start time. If you agree with this approach, or would prefer another, please let us know on the related idea.

Feedback

If you have any feedback we welcome hearing your thoughts on our TD Workflows ideas forum.

Also, if you have any ideas or feedback on the tutorial itself, we’d welcome them here!


Last modified: Apr 10 2018 22:42:14 UTC

If this article is incorrect or outdated, or omits critical information, let us know. For all other issues, access our support channels.