LineExecution icon
Flow icon
ExecutionFlow icon

Watch one critical flow and report its result to LINE

Get an outcome-aware LINE broadcast every time one specific business-critical Kestra flow reaches a terminal state, success or failure.

Categories
Business

Monitor a single business-critical pipeline and push a LINE notification the moment it finishes, whether it succeeds or fails. This blueprint watches one specific flow (here daily-revenue-close in the company.team namespace) and broadcasts an outcome-aware message to your LINE Official Account followers on every terminal state. It solves a common operational gap: stakeholders want a per-run confirmation for the one job that matters most, not a firehose of cluster-wide alerts and not silence until something breaks. Each broadcast prefixes the state, so a reader scanning their LINE feed can tell [SUCCESS] from [FAILED] at a glance.

How it works

  1. The on_critical_flow_terminal trigger of type io.kestra.plugin.core.trigger.Flow listens for executions reaching the terminal states in its states list: SUCCESS, WARNING, FAILED, KILLED, and CANCELLED.
  2. An io.kestra.plugin.core.condition.ExecutionFlow condition scopes the trigger to one exact target, matching only the configured namespace (company.team) and flowId (daily-revenue-close).
  3. When the watched flow finishes, the notify_outcome task of type io.kestra.plugin.line.LineExecution broadcasts to the LINE Messaging API. Its customMessage prefixes [{{ trigger.state ?? 'MANUAL' }}], and executionId resolves from {{ trigger.executionId ?? execution.id }} so the message links straight to the run. customFields add the flow name, owner, and tier as readable context.
  4. A retry (constant, 5 attempts, 10s apart) and a timeout: PT30S harden the single API call.

What you get

  • A LINE broadcast for every terminal run of the watched flow, good or bad.
  • A state-prefixed lead line readable without opening the execution.
  • A direct execution link plus flow, owner, and tier context in each message.
  • Hardened delivery that rides out transient LINE API 5xx, timeouts, and 429 rate limits.

Who it's for

  • Finance and operations teams who need per-run confirmation of a revenue or reporting close.
  • On-call engineers who want one critical pipeline surfaced to a mobile channel.
  • Platform teams standardizing Tier-1 flow notifications on LINE.

Why orchestrate this with Kestra

LINE has no concept of your pipelines, and a tool's own scheduler cannot tell you that another flow just finished. Kestra's event-driven Flow trigger fires the instant the watched execution transitions state, with no polling. Declarative YAML keeps the watcher versioned and reviewable, built-in retry and timeout make delivery resilient, and Kestra preserves the lineage from the original run to the alert through the resolved executionId. The result is reliable cross-flow signaling that the underlying tool cannot provide on its own.

Prerequisites

  • A LINE Messaging API channel (a LINE Official Account with the Messaging API enabled).
  • A Channel Access Token with permission to broadcast messages.
  • The critical flow you want to watch must exist; update namespace and flowId in the condition to match it.

Secrets

  • LINE_CHANNEL_ACCESS_TOKEN: the Channel Access Token used to authenticate to the LINE Messaging API and broadcast the message. Store it as a Kestra secret and never inline the token.

Quick start

  1. Issue a Channel Access Token in the LINE Developers console for your Messaging API channel.
  2. Save it in Kestra as the secret LINE_CHANNEL_ACCESS_TOKEN.
  3. Set the namespace and flowId in the ExecutionFlow condition to your critical flow.
  4. Trim the states list if you only want certain outcomes (for example, drop SUCCESS to alert on problems only).
  5. Update customMessage and customFields for the owning team, then deploy.
  6. Run the watched flow once to confirm the LINE message arrives. You can also run this flow manually as a smoke test, since executionId falls back to execution.id when no trigger is present.

How to extend

  • Add an independent second channel (Slack or email) so a LINE outage never goes unnoticed.
  • Pair this with a scheduled flow that alerts when no SUCCESS was observed in the expected window, covering the missing-run case a Flow trigger alone cannot detect.
  • Duplicate the blueprint per critical flow, or widen the condition to watch a group of flows.
  • Enrich customMessage with execution outputs or duration thresholds for richer context.

Links

Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.