New to Kestra?
Use blueprints to kickstart your first workflows.
Kestra subflow that probes a flaky HTTP endpoint with allowFailed, then exposes success or failure as a flow output that a parent LoopUntil recovery loop can evaluate.
Turn a flaky HTTP call into a signal instead of a crash. This Kestra blueprint is the health-check building block of a self-healing pattern: it probes an endpoint exactly once, refuses to fail even when the endpoint returns a 5xx, and reports the real outcome through a single typed flow output. A parent flow running io.kestra.plugin.core.flow.LoopUntil can then evaluate that output and decide whether to retry, trigger recovery, or declare the system healthy.
get_flaky_system_status task (io.kestra.plugin.core.kv.Get) reads the flaky_system_status KV entry, which simulates the current state of the target system (a value of 500 means unhealthy, 200 means healthy). errorOnMissing: true makes the flow fail fast if the entry was never seeded.call_flaky_system task (io.kestra.plugin.core.http.Request) calls https://httpbin.org/status/<code> with that value. The key detail is options.allowFailed: true, which makes a non-2xx response complete normally instead of failing the task.status output evaluates outputs.call_flaky_system.code == 200 and returns the string success or failure.The reason this lives in its own flow rather than inline in the parent: LoopUntil conditions can only see outputs of their direct children, so wrapping the probe in a subflow gives the loop a stable, one-level-down expression such as {{ outputs.attempt_flaky_call.outputs.status }}.
status output with exactly two values, easy to branch on with runIf.io.kestra.plugin.core.flow.Subflow.LoopUntil recovery loops that need a clean boolean-like signal from a child execution.Shell scripts that wrap curl and grep the exit code lose history the moment they finish. In Kestra, every probe is a full execution with logs, timings, and the resolved KV value, so you can see exactly what the system returned on each attempt. allowFailed is a first-class task option rather than a bash || true hack, typed flow outputs replace fragile stdout parsing, and the subflow boundary makes the health check reusable across every flow that needs it.
httpbin.org (or your real endpoint).flaky_system_status KV entry in the namespace. The parent blueprint seeds it with 500; you can also set it manually under Namespaces, KV Store.No secrets are required. If your real health endpoint needs auth, add a header such as Authorization: "Bearer {{ secret('HEALTHCHECK_TOKEN') }}" to the call_flaky_system task.
company.team namespace.flaky_system_status KV entry with value 500 or 200.status output on the execution's Outputs tab.uri at a real readiness endpoint and drop the KV lookup entirely.outputs.call_flaky_system.headers or the response body for deeper diagnostics.retry block to the HTTP task to absorb pure network blips before reporting failure.io.kestra.plugin.core.flow.Subflow and wait: true, then branch on outputs.<task_id>.outputs.status.