Skip to content

Configure Recipe Alerts

Recipe-level alerts are useful for temporary, localized testing. This type of alert can be configured in the UI or directly in the recipe's description.json file.

You can create variables for alert recipes, then reference them while setting up your alerts.

Warning

Considerations: (1) Recipe alerts merge up! Any recipe-level alerts you set will be promoted to a parent kitchen during a kitchen merge. Ensure that the alert settings are appropriate or remove them before merging. (2) Avoid non-portable alerts. You can hard-code alert recipients in the description.json file, or you can define alert variables as kitchen overrides and reference the variables in every recipe. These methods are not optimal, however, because you have to copy the configurations across recipes or enforce a standard variable naming convention.

Create an alert variable

Creating an alert variable lets you set multiple alerts for multiple users, and provides a reference to use in other variations of that recipe.

You can set up an alert variable from the Variables tab of any Variation page in a recipe or directly in the recipe's variables.json file.

Variables tab

  1. Navigate to the Recipes page, then select a recipe from the list.
  2. Select any variation to open the Variation page.
  3. Select the Variables tab.
  4. Click Add Variable and enter a name.

    For example, alerts.

  5. Enter a JSON object in the Recipe Values field. In the object, list the email recipients per event type that you want an alert for. For example:

    {
        "start": [
            "user2@company.com",
            "p6s7n7q9t0q1dk32@company.slack.com"
        ],
        "success": [
            "user2@company.com",
            "user3@company.com"
        ],
        "time_exceeded": "user3@company.com"
    }
    
  6. Select Add notes for changelog , describe the changes, then click Update.

The system saves the "alerts" variable in the recipe's variables.json file, so the variable can be referenced in any variation.

Visual example in Automation

(Screenshot of the Variables tab)

variables.json

  1. Navigate to the Recipes page, then select a recipe from the list.
  2. Click Recipe Actions.
  3. Select View Files.
  4. Select the variables.json file.
  5. Enter a JSON object that lists the email recipients for each of the event types you want to create an alert for. See the example below.
  6. Select Add notes for changelog , describe the changes, then click Update.
{
    "variable-list": {
        "alerts": {
            "start": [
                "user2@company.com",
                "p6s7n7q9t0q1dk32@company.slack.com"
            ],
            "success": [
                "user2@company.com",
                "user3@company.com"
            ],
            "failure": [
                "user2@company.com",
                "user3@company.com",
                "p6s7n7q9t0q1dk32@company.slack.com"
            ]
        }
    }
}

Set up recipe alerts

Recipes page

  1. Navigate to the Recipes page, then select a recipe from the list.
  2. Click Recipe Actions.
  3. Select Edit Alerts.
  4. Click Add Recipient.
  5. In the Email field:

    1. Optional. Enter the email address for an individual recipient.
    2. Optional. Click , then select a pre-set variable.

      For example, the variable created above.

  6. Check the boxes for the order run event types.

    Warning

    Warning and Time limit exceeded alerts will not be sent unless the thresholds are set in the relevant variation.

  7. Add more recipients as needed.

  8. Select Add notes for changelog , describe the changes, then click Update.

Visual example in Automation

(Screenshot of recipe alert setup dialog)

description.json

  1. Navigate to the Recipes page, then select a recipe from the list.
  2. Click Recipe Actions.
  3. Select View Files.
  4. Select the description.json file.
  5. Enter a JSON object that lists the email recipients or variables for each of the event types you want to create an alert for. See the example below.
  6. Select Add notes for changelog , describe the changes, then click Update.

If you're using an email delivery service instead of Automation's default aws-email service, some values in the example will differ. See Alerts Configuration for more information.

{
    "description": "All tests to run in staging environment",
    "recipe-emails": {
        "email-delivery-service": "aws-email",
        "recipe-startup-email-recipients": "{{alerts.start}}",
        "recipe-complete-email-recipients": "{{alerts.success}}",
        "recipe-error-email-recipients": "{{alerts.failure}}",
        "recipe-over-duration-email-recipients": [ "testeng@datakitchen.io" ],
        "recipe-warning-email-recipients": [ "testeng@datakitchen.io", "h8r9n2q9g7q1hf89@company.slack.com" ]
    }
}