New to Kestra?
Use blueprints to kickstart your first workflows.
Broadcast a LINE alert to your followers only when a Kestra flow breaches its duration SLA, using a MAX_DURATION SLA label.
Catch slow pipelines before your stakeholders do. This Kestra blueprint broadcasts a LINE alert to your followers the moment a watched flow runs longer than its agreed duration Service Level Agreement (SLA), and stays completely silent the rest of the time. It solves a common monitoring gap: pipelines that never fail outright but quietly drift past their runtime budget, breaking downstream freshness guarantees without ever tripping a failure alert. The check is label driven, so one alerter can govern many flows that each declare their own threshold.
MAX_DURATION SLA that stamps the label sla: miss on any execution that
exceeds its allowed duration. Fast runs are never labelled.io.kestra.plugin.core.trigger.Flow trigger watches terminal executions in the company.team
namespace, scoped by an io.kestra.plugin.core.condition.ExecutionNamespace condition (prefix: true).io.kestra.plugin.core.condition.ExecutionLabels condition filters that stream down to executions carrying
sla: miss, so the alert fires only for genuine breaches.notify_sla_breach task (io.kestra.plugin.line.LineExecution) authenticates with
channelAccessToken and posts a broadcast. It links the breaching execution via
{{ trigger.executionId ?? execution.id }} and adds customFields (Owner, Action, Threshold) plus a
customMessage naming the flow and namespace.The duration check stays in the watched flow's SLA on purpose: a Flow trigger only exposes trigger.executionId,
trigger.namespace, trigger.flowId, trigger.flowRevision, and trigger.state, not the upstream run's
duration. Gating at the SLA source is the supported, reliable pattern.
MAX_DURATION threshold.retry (constant, 5 attempts, 10s apart) and timeout: PT30S on the LINE call.LINE has no concept of your pipeline's runtime budget and cannot watch your executions. Kestra's event-driven
Flow trigger reacts to terminal states across an entire namespace, the declarative MAX_DURATION SLA labels
breaches at the source, and ExecutionLabels filters cleanly so you alert on signal, not noise. Built-in retry
and timeout make the notification itself dependable, the whole setup lives in version-controlled YAML, and
execution lineage links every alert straight back to the run that caused it. No cron or external scheduler can
express "tell me when any flow in this namespace overruns its SLA."
company.team that declare a MAX_DURATION SLA setting the label sla: miss on breach,
for example:sla:
- id: maxDuration
type: MAX_DURATION
duration: PT15M
behavior: CANCEL
labels:
sla: miss
Pick behavior: CANCEL (recommended, lands the run in CANCELLED) or behavior: NONE (keeps the natural
SUCCESS state and only labels). The states list here (SUCCESS, WARNING, CANCELLED) supports both and
deliberately omits FAILED so a companion failure monitor can own failures without double-alerting.
LINE_CHANNEL_ACCESS_TOKEN: the Channel Access Token used to authenticate to the LINE Messaging API and
broadcast the alert. Store it as a Kestra secret and never hardcode the value.LINE_CHANNEL_ACCESS_TOKEN.MAX_DURATION SLA with your threshold (for example duration: PT15M) that sets
the label sla: miss on breach.ExecutionNamespace condition at the namespace you want to govern and align states with your SLA
behavior.Owner custom field and the customMessage, then deploy.executionId falls back to execution.id.FAILED back to states (if you do not run a separate failure monitor) to also catch slow runs that failed.ExecutionNamespace prefix and token.customFields with run book links, severity, or the owning team derived from labels.