New to Kestra?
Use blueprints to kickstart your first workflows.
Turn Dataform assertions into a hard quality gate with Kestra. Capture the run exit code, post a Discord verdict, and fail the execution on broken checks.
Dataform assertions are data quality tests written next to the models, uniqueness, non-null, or any custom SQL condition, and dataform run executes them as part of the DAG, exiting non-zero when any assertion fails. What the CLI cannot do is decide what happens next. This blueprint makes the decision explicit through io.kestra.plugin.dataform.cli.DataformCLI: the run's exit code is captured as a boolean flow output, Discord receives a verdict either way, and io.kestra.plugin.core.execution.Fail turns broken assertions into a hard red execution that dependent flows and schedules cannot miss.
run_with_assertions (io.kestra.plugin.dataform.cli.DataformCLI) loads the project from namespace files, installs the pinned @dataform/core dependency in beforeCommands, and runs dataform run, which executes models and assertions in dependency order against BigQuery.|| rc=$?, so a failing assertion records the exit code instead of failing the task before the verdict is posted. A shell conditional converts the code to a boolean, emitted through Kestra's output protocol as {{ outputs.run_with_assertions.vars.run_ok }}.gate (io.kestra.plugin.core.flow.If) branches on the flag. On success, Discord gets a pass message. On failure, Discord gets the reason first, then io.kestra.plugin.core.execution.Fail fails the execution with an explicit error message.errors block posts a distinct alert when the flow crashes outside the controlled gate path.A cron job running dataform run exits non-zero into the void, nothing downstream notices, and the failure lives only in a log file. In Kestra, the exit code becomes a structured output, the decision becomes a visible If branch, the failure becomes a red execution with an explicit message, and everything downstream, dependent flows, schedules, alerting, reacts to that state automatically.
assertions in config blocks or standalone assertion SQLX files, stored as namespace files.GCP_SERVICE_ACCOUNT_JSON: the service account key JSON, delivered to the task as sa.json.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.GCP_SERVICE_ACCOUNT_JSON and DISCORD_WEBHOOK_URL secrets to your Kestra namespace.--tags to the command, as shown in the tag-scoped run blueprint.--actions to rerun a single failing assertion during incident triage without rebuilding the DAG.