Blueprints

Executes flow on flow trigger with HasRetryAttempt condition

Source

yaml
id: flow-condition-hastretryattempt
namespace: company.team

tasks:
  - id: send_slack_message
    type: io.kestra.plugin.notifications.slack.SlackExecution
    url: "{{ secret('SLACK_WEBHOOK') }}"
    channel: "#alert-engineering"
    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

About this blueprint

Trigger

This flow trigger executes the flow based on the HasRetryAttempt condition. When any flow task on retry enters the state specified in the in states under the HasRetryAttempt condition, this flow will get triggered. In this case, when any flow task on retry enters the FAILED state as defined in the in attribute, this flow will get triggered. This flow will send a slack message about the retry attempt being failed for that flowId. With HasRetryAttempt condition, you can enforce the condition on flow trigger that is based on the the state of the task of another flow on retry.

Slack Execution

Flow

Has Retry Attempt

More Related Blueprints

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra