New to Kestra?
Use blueprints to kickstart your first workflows.
Kestra blueprint that detects FAILED or WARNING executions with a Flow trigger and re-executes them as subflows, using execution labels to prevent retry loops.
Recover from transient failures without a human clicking restart. This Kestra blueprint listens for executions that end in FAILED or WARNING anywhere under a namespace prefix, waits a short grace period, and re-executes the failed flow by launching it as a subflow with the same flow id and namespace read from the trigger context. The critical piece is loop protection: every resubmitted execution is stamped with an implicit: true label, and the trigger only matches executions labeled implicit: false, so a resubmission that fails again can never trigger itself into an infinite retry storm.
listen trigger (io.kestra.plugin.core.trigger.Flow) watches execution state changes. An io.kestra.plugin.core.condition.ExecutionStatus condition matches terminal FAILED and WARNING states, and io.kestra.plugin.core.condition.ExecutionNamespace with prefix: true scopes it to the company tree.io.kestra.plugin.core.condition.ExecutionLabels condition requires the label implicit: false on the failed execution. Flows that opt in to auto resubmission carry this label; resubmitted runs carry implicit: true and are therefore ignored, breaking the loop after one retry.log_failure task (io.kestra.plugin.core.log.Log) records which flow and execution are being resubmitted, along with the triggering execution's labels.sleep task (io.kestra.plugin.core.flow.Sleep) waits PT3S as a simple backoff before retrying (tune this to your failure modes).retry_subflow task (io.kestra.plugin.core.flow.Subflow) starts a fresh execution of {{ trigger.flowId }} in {{ trigger.namespace }} with wait: true and transmitFailed: false, so this alerting flow itself stays green even when the retry fails, and stamps the run with implicit: true.disabled: true as a safety default: review the conditions and scope before switching it on.Task level retries only help while the execution is still alive; once a run has failed terminally, something outside it must decide to try again. Kestra's Flow trigger makes that decision declarative: conditions define which failures qualify, Subflow re-executes the target generically for any flow id in the namespace, and execution labels carry the retry state with no external database. The whole recovery policy is one small flow you can version, review, and disable instantly.
implicit: false so they match the ExecutionLabels condition.disabled: false on the trigger to activate it.namespace: company to the tree you want covered.implicit: false to a test flow and make it fail on purpose.disabled: false on the listen trigger.implicit: true) does not re-trigger.Sleep duration or replace it with an exponential backoff via multiple conditions.io.kestra.plugin.core.condition.ExecutionFlow condition to limit resubmission to specific critical flows.io.kestra.plugin.slack.notifications.SlackIncomingWebhook.transmitFailed: true and add an errors branch to escalate when the retry also fails.