If icon
Request icon
Assert icon
List icon
OutputValues icon
Log icon
Switch icon
Fail icon
Pause icon
Schedule icon

Gate Kestra Subflow Changes Against Every Caller Before Deploying

Block Kestra subflow changes that break callers via missing inputs, removed outputs or deleted flows. Deploy safe changes and audit call sites nightly.

Categories
Infrastructure

Kestra saves a subflow that adds a required input, drops an output, or is disabled or deleted while other flows still call it. The callers then fail at run time. This flow checks every call site first.

How it works

  1. With candidate_source, Kestra's own validator checks the candidate. It must be one valid flow of shared_namespace, and never this gate.
  2. The Kestra plugin lists the flows in shared_namespace, and one bounded API search returns every flow under caller_namespace_prefix. Above max_flows the run fails rather than skip callers.
  3. A jq check walks every Subflow task, including those nested in Parallel, If or errors. It flags a required input that is not passed, a read output the subflow no longer returns, and a disabled or missing subflow. It also warns about ignored inputs, input type changes and calls built from expressions.
  4. A Switch acts on the result. A breaking candidate fails the run, or with allow_breaking waits 8 hours for approval. A safe candidate is deployed when dry_run is false and its source is read back to confirm. An identical candidate is a no-op.
  5. The nightly schedule runs the same check on the live flows and fails if any call site is broken.

What you get

  • The caller, task and reason for each problem, and the decision and findings outputs for CI.
  • No deploy until callers are fixed or someone approves the break.
  • Repeated runs with the same candidate never create a new revision.

Who it's for

Platform teams that maintain shared subflows other teams call.

Why orchestrate this with Kestra

It reads the live flow definitions through the Kestra API, and gets approval, retries, concurrency limits and history for free.

Prerequisites

  • Kestra 2.x with API access to read flows and to create or update flows in shared_namespace.
  • The Kestra plugin.

Secrets

  • KESTRA_USERNAME: user for basic auth against the Kestra API (required).
  • KESTRA_PASSWORD: password of that user (required).

Quick start

  1. Add the two secrets and set kestra_url, shared_namespace and caller_namespace_prefix.
  2. Run it once without a candidate to audit today's call sites.
  3. From CI, pass the changed file as candidate_source, for example with curl -F candidate_source=<flows/my-subflow.yaml. Keep dry_run true for pull requests and set it to false on merge.
  4. Enable the nightly_audit schedule.

How to extend

  • Send a Slack or email alert from the failing case, or open an issue per broken caller.
  • Treat input type changes as breaking for stricter teams.

Limitations: calls whose namespace or flowId is an expression are listed for review, not checked. Output reads are matched in the outputs.<task>.outputs.<name> form. The subflow() Pebble function is not covered.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.