Schedule icon
Request icon
Script icon
Process icon
Log icon
Switch icon
SlackIncomingWebhook icon
Fail icon

Hasura GraphQL Metadata Desync and Schema Inconsistency Sentinel

Audit Hasura GraphQL Engine metadata consistency against Postgres, detect schema desynchronization, and trigger Slack incident alerts to prevent broken APIs.

Categories
Infrastructure

Automated GraphQL reliability sentinel that interrogates the Hasura GraphQL Engine metadata API on a recurring schedule to audit schema consistency against underlying Postgres tables, classify desynchronization severity, and dispatch Slack incident alerts when broken entity dependencies or missing database columns are detected.

How it works

  1. A schedule trigger activates every fifteen minutes to probe the Hasura GraphQL Engine instance.
  2. An HTTP request task queries Hasura's /v1/metadata endpoint utilizing the get_inconsistent_metadata administrative command.
  3. An embedded Python script processes the returned JSON payload, interrogating the is_consistent boolean flag and extracting the count and names of any broken entity relationships.
  4. An informational log task records the evaluated consistency metrics and current schema classification.
  5. A Switch flow control task branches execution according to the evaluated status:
    • CONSISTENT_HEALTHY: Confirms schema alignment and logs nominal operational telemetry.
    • DESYNC_WARNING: Emits a non-blocking advisory notification when minor discrepancies fall within allowable limits.
    • CRITICAL_METADATA_DESYNC: Dispatches a detailed Slack incident webhook with broken entity names, execution deep links, and triggers a downstream execution failure gate to quarantine corrupted deployments.
  6. An immutable final audit log records the comprehensive health verdict and inconsistency metrics in Kestra execution history.

What you get

  • Proactive schema drift and desynchronization detection before frontend web or mobile GraphQL queries fail.
  • Automated catalog health audits catching broken remote schemas, dropped Postgres columns, and orphaned foreign keys.
  • Rich Slack notifications alerting platform engineering teams with specific broken entity names.
  • Automated execution failure gates that halt dependent deployment pipelines when database migrations break Hasura metadata.
  • Complete, immutable audit records tracking GraphQL catalog stability across continuous delivery cycles.

Who it's for

  • Platform Engineers and SREs maintaining production Hasura GraphQL Engine deployments.
  • Backend Developers and Database Administrators executing continuous schema migrations against PostgreSQL databases.
  • Frontend and Fullstack Engineers reliant on stable, unbroken GraphQL API contracts.

Why orchestrate this with Kestra

  • Declarative YAML orchestrates API health polling, payload parsing, and incident dispatching without dedicated monitoring agents.
  • Native secret masking ensures administrative API tokens and Slack webhook URLs remain confidential during automated runs.
  • Built-in conditional branching enables granular escalation policies tailored to schema severity tiers.
  • Centralized execution timelines provide instant diagnostic visibility into historical metadata failure patterns.

Prerequisites

  • Reachable Hasura GraphQL Engine instance (local Docker container or hosted deployment).
  • Network connectivity between Kestra and the Hasura administrative endpoint.

Secrets

  • HASURA_ADMIN_SECRET: Administrative secret token granting access to Hasura's /v1/metadata API.
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook URL used to transmit critical schema inconsistency incident alerts.

Quick start

  1. Configure the HASURA_ADMIN_SECRET and SLACK_WEBHOOK_URL secrets in your Kestra namespace or environment variables.
  2. Import this blueprint into your Kestra instance under company.infrastructure.
  3. Run a manual test execution pointing to your Hasura endpoint to verify connectivity and clean schema parsing.
  4. Enable the metadata_audit_schedule trigger to maintain continuous 15-minute schema monitoring.

How to extend

  • Add an automated Hasura metadata reload task (reload_metadata) in the remediation branch to automatically attempt self-healing before alerting engineers.
  • Chain this flow as a post-migration verification gate following Flyway or Liquibase database deployments.
  • Route separate alerts to PagerDuty or Opsgenie when critical core business models desynchronize.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.