New to Kestra?
Use blueprints to kickstart your first workflows.
Roll back a database to a Liquibase tag with Kestra. A confirmation input gates the rollback and Slack receives an audit message for every run.
Rolling back a database at 2 a.m. usually means someone with production credentials improvising SQL under pressure. This blueprint replaces that with an auditable one-click operation: the operator supplies a Liquibase tag and an explicit confirmation, io.kestra.plugin.liquibase.CLI runs liquibase rollback to revert every change set applied after that tag, and Slack records who rolled back what. Without the confirmation, the flow refuses to run at all.
tag, the Liquibase tag to return to, and confirm, a boolean that defaults to false.require_confirmation (io.kestra.plugin.core.execution.Fail) uses its condition property to fail the execution immediately when confirm is false, with an error message demanding explicit confirmation. Nothing touches the database on that path.rollback_to_tag (io.kestra.plugin.liquibase.CLI) connects through the standard Liquibase environment variables filled from secrets. The demo changelog creates a table, tags the database v1.0, then adds a column, and the task first runs liquibase update so the rollback has a seeded state to revert. Against a real database you remove that update line and keep only the rollback command.liquibase rollback --tag={{ inputs.tag }} reverts every change set recorded after the tag, using Liquibase's automatic rollback for operations like createTable and addColumn.audit_rollback posts the tag and execution identifier to Slack, and the errors block alerts when the rollback is refused or fails partway.tagDatabase who want those tags actionable.Liquibase can rewind to a tag, but the command alone has no confirmation step, no audit trail, and no record of who ran it. Kestra adds typed inputs with a boolean guard, a Fail task that encodes the confirmation policy in the flow itself, secrets that keep production credentials away from terminals, and an execution history where every rollback attempt, refused or completed, is preserved.
DB_URL secret to jdbc:h2:file:./demo-db with username sa and an empty password; the seeded update makes the rollback self-contained. For production, use your real JDBC URL, such as jdbc:postgresql://db-host:5432/app, and remove the seeding update command.tagDatabase, so there is always a named point to return to.DB_URL: JDBC URL of the target database.DB_USERNAME: database username.DB_PASSWORD: database password.SLACK_WEBHOOK_URL: Slack incoming webhook URL.liquibase update command and point the secrets at a real database whose changelog already contains tags.namespaceFiles synced from Git instead of the inline demo changelog.