New to Kestra?
Use blueprints to kickstart your first workflows.
Detect schema drift nightly with the Kestra Liquibase Diff task. Compare live and reference databases, capture a diff changelog, and alert Discord on drift.
Schema drift is the gap between the database you think you have and the one production is actually running, a hotfix column added by hand, an index dropped during an incident, a migration applied to staging but never to production. This blueprint makes drift measurable: every night io.kestra.plugin.liquibase.Diff compares the live database against a reference database, writes the differences as a Liquibase changelog artifact, and a small Python step reduces that artifact to a drift boolean that gates a Discord alert. No drift, no noise.
diff_schemas (io.kestra.plugin.liquibase.Diff) connects to the live database through url and to the baseline through referenceUrl, with all credentials pulled from Kestra secrets. Because changelogFile is set, the task runs diff-changelog and writes every difference as a change set in drift.xml, which outputFiles uploads to internal storage.detect_drift (io.kestra.plugin.scripts.python.Script on the Process runner) pulls drift.xml in through inputFiles, counts the changeSet entries, and emits drift and changes as task outputs through Kestra's output protocol.alert_on_drift (io.kestra.plugin.core.flow.If) posts to Discord only when drift is true, including the change count and a pointer to the generated changelog.errors block sends a distinct alert when the comparison itself fails, so a broken connection is never mistaken for a clean diff.Schedule trigger runs the check nightly at 02:00.Liquibase can compute a diff, but drift detection is only useful as a routine: run every night, keep every artifact, alert only when something changed, and page someone when the check itself breaks. Kestra provides the schedule, the internal storage that preserves each night's diff for later review, the conditional alerting, and the error handling, all declared in one flow instead of a cron entry plus three shell scripts.
jdbc:h2:file:./live-db and jdbc:h2:file:./reference-db with username sa and an empty password. For production, use your real JDBC URLs, for example jdbc:postgresql://prod-host:5432/app against jdbc:postgresql://staging-host:5432/app.taskRunner to Docker.DB_URL, DB_USERNAME, DB_PASSWORD: connection for the live database.REFERENCE_DB_URL, REFERENCE_DB_USERNAME, REFERENCE_DB_PASSWORD: connection for the reference database.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.drift.xml, and enable the nightly trigger.referenceUrl at a database freshly built by liquibase update, as in the changelog CI validation blueprint.io.kestra.plugin.core.execution.Fail if you want drift to block a deployment pipeline.