SlackExecution icon
Flow icon
HasRetryAttempt icon

Executes flow on flow trigger with HasRetryAttempt condition

Trigger a Kestra flow when another flow's retry attempt fails. Use the HasRetryAttempt condition to centralize retry monitoring and Slack escalation.

Categories
Core
id: flow-condition-hasretryattempt
namespace: company.team

tasks:
  - id: send_slack_message
    type: io.kestra.plugin.slack.notifications.SlackExecution
    url: "{{ secret('SLACK_WEBHOOK') }}"
    executionId: "{{ trigger.executionId }}"
    payload: "Retry attempt failed for {{ trigger.flowId }}"

triggers:
  - id: flow_condition
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.HasRetryAttempt
        in:
          - FAILED

Catch failing retries across your entire Kestra instance and react automatically. This blueprint wires a Flow trigger to the HasRetryAttempt condition so that whenever a task in any other flow fails a retry attempt, this flow fires and posts a Slack alert. It closes a common observability gap: retries often fail silently inside an execution and teams discover it hours later. Here, every failed retry becomes an event you can route and escalate.

How it works

  • A io.kestra.plugin.core.trigger.Flow trigger listens for executions across all flows in the instance.
  • The trigger carries a io.kestra.plugin.core.condition.HasRetryAttempt condition with in: [FAILED], so it only fires when a retry attempt entered the FAILED state.
  • The send_slack_message task (io.kestra.plugin.slack.notifications.SlackExecution) then posts to a webhook, embedding the execution via executionId: "{{ trigger.executionId }}" and a payload naming {{ trigger.flowId }}.

What you get

  • Instance-wide detection of failed retries without editing every downstream flow.
  • Immediate Slack notification linking back to the offending execution.
  • A single, declarative place to manage retry-failure escalation.

Who it's for

  • Platform and data teams running many flows who need centralized failure visibility.
  • On-call and SRE rotations that want retry failures surfaced in chat.
  • Teams hardening reliability and SLAs for orchestration pipelines.

Why orchestrate this with Kestra

Kestra's event-driven Flow triggers let one flow react to the lifecycle of any other flow, something a tool's own scheduler cannot express because it has no cross-pipeline event bus or shared execution state. The HasRetryAttempt condition filters on retry outcomes specifically, the alerting task itself can be retried, execution lineage is preserved, and everything is declarative YAML you can version, review, and reuse.

Prerequisites

A running Kestra instance and a Slack incoming webhook.

Secrets

  • SLACK_WEBHOOK: the Slack incoming webhook URL used by send_slack_message.

Quick start

  1. Add this flow to your namespace.
  2. Create a Slack incoming webhook and store it as the SLACK_WEBHOOK secret.
  3. Trigger a flow elsewhere that retries and fails, then confirm the Slack alert arrives.

How to extend

  • Add more states (for example WARNING) to the in list to broaden what counts.
  • Swap SlackExecution for an email, PagerDuty, or webhook task to change escalation.
  • Add namespace or label conditions to scope the trigger to specific flows or teams.

Links

Orchestrate with Kestra
Orchestrate Slack with Kestra
Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.