We support receiving alerts for the following events:

  • Run fails
  • Deployment fails
  • Deployment succeeds

How to setup alerts

1

Create a new alert

Click on “Alerts” in the left hand side menu, then click on “New alert” to open the new alert modal.

2

Choose your alert method

Choose to be notified by email, Slack notification or webhook whenever:

  • a run fails

  • a deployment fails

  • a deployment succeeds

3

Delete or disable alerts

Click on the triple dot menu on the right side of the table row and select “Disable” or “Delete”.

Alert webhooks

For the alert webhooks you can use the SDK to parse them. Here is an example of how to parse the webhook payload in Remix:

import { ActionFunctionArgs, json } from "@remix-run/server-runtime";
import { webhooks, WebhookError } from "@trigger.dev/sdk/v3";

export async function action({ request }: ActionFunctionArgs) {
  // Make sure this is a POST request
  if (request.method !== "POST") {
    return json({ error: "Method not allowed" }, { status: 405 });
  }

  try {
    // Construct and verify the webhook event
    // This secret can be found on your Alerts page when you create a webhook alert
    const event = await webhooks.constructEvent(request, process.env.ALERT_WEBHOOK_SECRET!);

    // Process the event based on its type
    switch (event.type) {
      case "alert.run.failed": {
        console.log("[Webhook Internal Test] Run failed alert webhook received", { event });
        break;
      }
      case "alert.deployment.success": {
        console.log("[Webhook Internal Test] Deployment success alert webhook received", { event });
        break;
      }
      case "alert.deployment.failed": {
        console.log("[Webhook Internal Test] Deployment failed alert webhook received", { event });
        break;
      }
      default: {
        console.log("[Webhook Internal Test] Unhandled webhook type", { event });
      }
    }

    // Return a success response
    return json({ received: true }, { status: 200 });
  } catch (err) {
    // Handle webhook errors
    if (err instanceof WebhookError) {
      console.error("Webhook error:", { message: err.message });
      return json({ error: err.message }, { status: 400 });
    }

    if (err instanceof Error) {
      console.error("Error processing webhook:", { message: err.message });
      return json({ error: err.message }, { status: 400 });
    }

    // Handle other errors
    console.error("Error processing webhook:", { err });
    return json({ error: "Internal server error" }, { status: 500 });
  }
}

Common properties

When you create a webhook alert, you’ll receive different payloads depending on the type of alert. All webhooks share some common properties:

id
string

A unique identifier for this webhook event

created
datetime

When this webhook event was created

webhookVersion
string

The version of the webhook payload format

type
string

The type of alert webhook. One of: alert.run.failed, alert.deployment.success, or alert.deployment.failed

Run Failed Alert

This webhook is sent when a run fails. The payload is available on the object property:

object.task.id
string

Unique identifier for the task

object.task.filePath
string

File path where the task is defined

object.task.exportName
string

Name of the exported task function

object.task.version
string

Version of the task

object.task.sdkVersion
string

Version of the SDK used

object.task.cliVersion
string

Version of the CLI used

object.run.id
string

Unique identifier for the run

object.run.number
number

Run number

object.run.status
string

Current status of the run

object.run.createdAt
datetime

When the run was created

object.run.startedAt
datetime

When the run started executing

object.run.completedAt
datetime

When the run finished executing

object.run.isTest
boolean

Whether this is a test run

object.run.idempotencyKey
string

Idempotency key for the run

object.run.tags
string[]

Associated tags

object.run.error
object

Error information

object.run.isOutOfMemoryError
boolean

Whether the run was an out-of-memory error

object.run.machine
string

Machine preset used for the run

object.run.dashboardUrl
string

URL to view the run in the dashboard

object.environment.id
string

Environment ID

object.environment.type
string

Environment type (STAGING or PRODUCTION)

object.environment.slug
string

Environment slug

object.organization.id
string

Organization ID

object.organization.slug
string

Organization slug

object.organization.name
string

Organization name

object.project.id
string

Project ID

object.project.ref
string

Project reference

object.project.slug
string

Project slug

object.project.name
string

Project name

Deployment Success Alert

This webhook is sent when a deployment succeeds. The payload is available on the object property:

object.deployment.id
string

Deployment ID

object.deployment.status
string

Deployment status

object.deployment.version
string

Deployment version

object.deployment.shortCode
string

Short code identifier

object.deployment.deployedAt
datetime

When the deployment completed

object.tasks
array

Array of deployed tasks with properties: id, filePath, exportName, and triggerSource

object.environment.id
string

Environment ID

object.environment.type
string

Environment type (STAGING or PRODUCTION)

object.environment.slug
string

Environment slug

object.organization.id
string

Organization ID

object.organization.slug
string

Organization slug

object.organization.name
string

Organization name

object.project.id
string

Project ID

object.project.ref
string

Project reference

object.project.slug
string

Project slug

object.project.name
string

Project name

Deployment Failed Alert

This webhook is sent when a deployment fails. The payload is available on the object property:

object.deployment.id
string

Deployment ID

object.deployment.status
string

Deployment status

object.deployment.version
string

Deployment version

object.deployment.shortCode
string

Short code identifier

object.deployment.failedAt
datetime

When the deployment failed

object.error.name
string

Error name

object.error.message
string

Error message

object.error.stack
string

Error stack trace (optional)

object.error.stderr
string

Standard error output (optional)

object.environment.id
string

Environment ID

object.environment.type
string

Environment type (STAGING or PRODUCTION)

object.environment.slug
string

Environment slug

object.organization.id
string

Organization ID

object.organization.slug
string

Organization slug

object.organization.name
string

Organization name

object.project.id
string

Project ID

object.project.ref
string

Project reference

object.project.slug
string

Project slug

object.project.name
string

Project name