New to Kestra?
Use blueprints to kickstart your first workflows.
Audit Apache Avro contracts for schema drift, infer schemas from Ion streams, verify bidirectional serialization, and alert Slack on breaking changes.
Modern analytical data platforms and event-driven architectures rely on Apache Avro data contracts (.avsc) to guarantee schema compatibility between transactional producers (microservices, Kafka, Debezium CDC) and downstream data lakehouses (Iceberg, Delta Lake, Snowflake, BigQuery). When upstream producers introduce breaking schema mutations, such as altering field types, removing non-nullable attributes, or renaming keys without aliases, downstream pipelines break abruptly or ingest corrupted columns that require complex data backfills.
This sentinel workflow automates data contract governance and schema drift auditing. It periodically ingests staged data batches, dynamically infers valid Apache Avro schemas using Kestra native serialization engines (InferAvroSchemaFromIon), executes strict forward serialization (IonToAvro), validates bidirectional deserialization fidelity (AvroToIon), classifies contract health into operating tiers via Pebble logic, dispatches targeted Slack alerts to data platform teams, quarantines offending payloads, and generates an auditable compliance ledger.
Schedule trigger awakens the workflow hourly or upon new batch ingestion events in the data landing zone.io.kestra.plugin.core.storage.Write.io.kestra.plugin.serdes.avro.InferAvroSchemaFromIon inspects the stream, evaluates record structures across configurable sample sizes, and synthesizes a valid .avsc Avro schema artifact.io.kestra.plugin.serdes.avro.IonToAvro compiles raw records into binary Avro format enforcing the newly inferred schema, catching incompatible line formats with configurable error handling.io.kestra.plugin.serdes.avro.AvroToIon deserializes the binary Avro artifact back into Ion records, verifying full round-trip parity and zero loss of attributes.Labels execution task evaluates serialized record volumes, round-trip parity, and drift flags to assign an operational status tier (COMPLIANT_CONTRACT, WARNING_SCHEMA_DRIFT, or CRITICAL_SCHEMA_BREAK).Switch flow-control task routes execution based on the evaluated contract tier: breaking changes trigger immediate Slack incident alerts and payload quarantine, while compliant batches trigger notification of downstream pipeline readiness.Log task records comprehensive audit telemetry including schema artifact URIs, serialized row counts, and execution timestamps..avsc Avro schema artifacts from raw data streams.InferAvroSchemaFromIon, IonToAvro, AvroToIon) eliminate external container dependencies and Python runtime overhead.SLACK_WEBHOOK_URL: Incoming webhook URL for posting schema contract alerts to the data platform operations channel (required).SLACK_WEBHOOK_URL secret in your Kestra namespace.introduce_drift_simulation: false) to verify clean schema inference, binary serialization, round-trip verification, and audit logging.introduce_drift_simulation: true to verify that the sentinel catches breaking changes, dispatches Slack alerts, and creates quarantine artifacts.COMPLIANT_CONTRACT branch to trigger ingestion only when data contracts pass verification.CRITICAL_SCHEMA_BREAK branch for mission-critical real-time streams.