OpsgenieExecution icon
Flow icon
ExecutionStatus icon
ExecutionNamespace icon

Send a notification via Opsgenie when a workflow fails

Send an Opsgenie alert when a Kestra workflow fails. Automate incident creation and on-call notifications for critical production pipeline monitoring.

Categories
Infrastructure

Automatically open an Opsgenie alert whenever a Kestra workflow execution fails or finishes with a warning. This system flow turns pipeline failures into actionable, on-call incidents by routing alerts to the right team, user, escalation, and schedule, so problems get noticed and resolved instead of sitting silently in a log. It solves the core monitoring gap in data and infrastructure operations: knowing the moment something breaks without watching the UI all day.

How it works

The flow is wired to a io.kestra.plugin.core.trigger.Flow trigger that listens to executions across your instance. Two conditions filter what matters: io.kestra.plugin.core.condition.ExecutionStatus fires only on FAILED and WARNING statuses, and io.kestra.plugin.core.condition.ExecutionNamespace limits the scope to the company namespace and all nested child namespaces using a PREFIX comparison.

When a matching execution is detected, the send_notification task of type io.kestra.plugin.opsgenie.OpsgenieExecution posts an alert to Opsgenie. The alert message embeds {{ trigger.executionId }} and {{ taskrun.startDate }}, sets an alias of ExecutionError, assigns P1 priority, attaches tags, and routes to configured responders (team, user, escalation, schedule) and visibleTo audiences by their Opsgenie IDs.

What you get

  • Real-time Opsgenie alerts the moment a workflow fails or warns
  • On-call routing to teams, users, escalations, and schedules
  • P1 priority and consistent tagging for fast triage
  • Namespace-scoped monitoring that covers every child flow automatically

Who it's for

  • Platform and DevOps engineers running Kestra in production
  • Data engineers who need to be paged when pipelines break
  • SRE and on-call teams that already standardize on Opsgenie

Why orchestrate this with Kestra

Opsgenie raises alerts but has no awareness of your pipeline runs. Kestra closes that gap. The event-driven Flow trigger reacts to execution state changes instantly, with no polling or cron, something Opsgenie cannot do on its own. You get retries, full execution lineage, and a declarative YAML definition that lives in version control. Add one system flow and every current and future workflow under the namespace inherits failure alerting for free.

Prerequisites

  • A running Kestra instance
  • An Opsgenie account with an alert API integration
  • Responder and visibility IDs (team, user, escalation, schedule) from Opsgenie

Secrets

  • OPSGENIE_REQUEST: the Opsgenie alert API request URL used by the url property of the send_notification task

Quick start

  1. Add the OPSGENIE_REQUEST secret to your Kestra instance.
  2. Replace the responders and visibleTo IDs with your own Opsgenie IDs.
  3. Adjust the ExecutionNamespace condition to match your namespace.
  4. Deploy the flow and run any flow under that namespace that fails to confirm the alert lands.

How to extend

  • Broaden or narrow the trigger by editing the ExecutionStatus and ExecutionNamespace conditions.
  • Add parallel notification tasks (Slack, email, PagerDuty) alongside Opsgenie.
  • Enrich the alert message with namespace, flow ID, or labels from the trigger payload.
  • Lower the priority for warnings versus hard failures by splitting into separate routed flows.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.