New to Kestra?
Use blueprints to kickstart your first workflows.
Autonomous data governance in Kestra with DuckDB, OpenLineage, and Marquez. Automate schema facet extraction, quality guardrails, and Slack alerts.
Diagram unavailable
We could not build the topology for this blueprint. The flow itself is valid, use the YAML on the left to run it.
Automate end-to-end data lineage extraction during DuckDB analytical SQL transformations, formatting standard OpenLineage 1-0-0 run event payloads (schema, input/output datasets, parent job facets) and emitting them to a Marquez metadata backend with automated quality gating and Slack alerting.
In enterprise data platforms, maintaining verifiable, end-to-end data lineage is mandatory for regulatory compliance (e.g., BCBS 239, GDPR, HIPAA), root-cause debugging, and data catalog synchronization. When data transformations run across distributed pipelines, metadata often becomes fragmented, resulting in silent data drift and broken downstream dependencies.
setup_governance_context (io.kestra.plugin.core.log.Log) logs the pipeline execution ID, target database, and Marquez metadata endpoint.run_duckdb_transformation (io.kestra.plugin.jdbc.duckdb.Queries) executes in-process SQL analytical aggregation on DuckDB tables, aggregating raw transactions into a curated customer revenue mart.extract_openlineage_facets (io.kestra.plugin.scripts.python.Commands) executes containerized Python in python:3.11-slim, constructing compliant OpenLineage 1-0-0 run events with NominalTimeRunFacet, SchemaDatasetFacet, input/output dataset namespaces, and outputs runtime variables via Kestra ion format.emit_openlineage_to_marquez (io.kestra.plugin.core.http.Request) transmits the OpenLineage JSON payload directly to the Marquez REST API (POST /api/v1/lineage).verify_marquez_ingestion (io.kestra.plugin.core.log.Log) logs the ingestion response status.check_governance_guardrail (io.kestra.plugin.core.flow.If) evaluates validation results. On success, it triggers notify_slack_success. On failure or schema drift, it alerts DataOps via notify_slack_alert and halts execution using require_compliance_officer_approval (io.kestra.plugin.core.flow.Pause) until compliance officers sign off.Extracting data lineage alongside SQL transformations traditionally requires bulky external agents or manual catalog updates. Kestra combines the compute execution layer (DuckDB), containerized metadata extraction (Python), network dispatch (HTTP Request), conditional routing (If), and human-in-the-loop governance (Pause) into a single, declarative workflow.
LINEAGE_WEBHOOK_KEY: Secret authentication key for the inbound webhook trigger.SLACK_WEBHOOK_URL: Slack Incoming Webhook URL for governance notifications.MARQUEZ_API_KEY: (Optional) Bearer token for protected Marquez or OpenLineage API endpoints.| Name | Type | Default | Description |
|---|---|---|---|
pipeline_id |
STRING | customer-revenue-mart-v1 |
Unique identifier of the analytical data pipeline. |
marquez_endpoint |
STRING | http://marquez:5000/api/v1/lineage |
HTTP URL of the Marquez or OpenLineage ingestion API. |
duckdb_database_path |
STRING | /tmp/kestra_analytics.duckdb |
Filesystem path for local DuckDB storage. |
alert_on_schema_drift |
BOOLEAN | true |
Whether to pause the flow and trigger Slack alerts if schema drift is detected. |
LINEAGE_WEBHOOK_KEY, SLACK_WEBHOOK_URL, and optionally MARQUEZ_API_KEY in your Kestra namespace.