Detects Apache Airflow and dbt pipeline failures, identifies new columns added in upstream PostgreSQL databases, safely adds the missing columns in Snowflake without deleting data, and restarts the pipeline from where it stopped in under 90 seconds.
// Checked in under 5ms before any Snowflake table modification
rule pipeline_autoheal_gate {
match:
pipeline.state == "failed" &&
error.type == "missing_column_error" &&
schema.change_type == "add_column"
allow:
snowflake.execute_sql(allow_add_column_only: true) &&
airflow.retry_task(mode: "safe_checkpoint_rerun")
action:
autoheal_or_escalate(
channel: "#data-ops-alerts",
approval_type: "tamper_proof_single_use"
)
}