New to Kestra?
Use blueprints to kickstart your first workflows.
Send Sentry alerts when a Kestra workflow fails. Capture flow failure context and surface incidents directly in your Sentry error tracking dashboard.
id: sentry-alert
namespace: company.team
tasks:
- id: fail
type: io.kestra.plugin.core.execution.Fail
errors:
- id: alert_on_failure
type: io.kestra.plugin.sentry.SentryAlert
dsn: "{{ secret('SENTRY_DSN') }}"
payload: |
{
"timestamp": "{{ execution.startDate }}",
"platform": "java",
"level": "error",
"transaction": "/execution/id/{{ execution.id }}",
"server_name": "localhost:8080",
"extra": {
"Namespace": "{{ flow.namespace }}",
"Flow ID": "{{ flow.id }}",
"Execution ID": "{{ execution.id }}",
"Link": "http://localhost:8080/ui/executions/{{flow.namespace}}/{{flow.id}}/{{execution.id}}"
}
}
Turn Kestra workflow failures into actionable Sentry incidents. This blueprint wires Sentry error tracking directly into your orchestration layer, so every failed flow surfaces in your Sentry dashboard with the namespace, flow ID, execution ID, and a direct link back to the run. Instead of polling logs or waiting for someone to notice a broken pipeline, your on-call team gets a Sentry event the instant something breaks, with the context needed to triage it fast.
io.kestra.plugin.core.execution.Fail task stands in for whatever real task you want to guard, forcing the execution into a failed state for demonstration.errors block.alert_on_failure task of type io.kestra.plugin.sentry.SentryAlert fires, authenticating with your dsn and sending a JSON payload to Sentry.{{ execution.id }}, {{ flow.namespace }}, {{ flow.id }}, and {{ execution.startDate }}, plus a clickable link straight to the failed execution in the Kestra UI.extra payload field.Sentry is built to capture errors from running applications, but it has no scheduler and no concept of a pipeline failing. Kestra fills that gap. The errors block is event driven: it reacts the moment a task fails, no cron polling required. You define the alerting once in declarative YAML and attach it to any flow, you can layer retries on upstream tasks so Sentry only fires on genuine failures, and execution metadata flows in automatically for lineage and traceability. The result is a single, versioned definition of both your work and how failures get reported.
SENTRY_DSN: your Sentry project DSN, found under project settings in the "Client Keys (DSN)" section. See the Sentry DSN docs.SENTRY_DSN secret to your Kestra instance.fail task triggers the error path and a test event appears in Sentry.fail task with your actual pipeline tasks; the errors block guards all of them.payload JSON to set level, transaction, server_name, or add fields to extra.event_id (a UUID) in the payload to group related failures, or omit it to let Kestra generate one.errors block for multi-channel notifications.