snow dbt execute commands¶
Note
Some features described on this page require a dbt project object that uses the mutable live version. To get a live-version object, opt in to the 2026_06 behavior change bundle or ask your Snowflake account representative to enable the separate single live version feature. Then create or replace the object, or migrate an existing versioned object with SYSTEM$MIGRATE_DBT_PROJECT. For details, see dbt Projects on Snowflake: dbt project objects migrate to a single mutable live version.
The snow dbt execute command executes one of the following dbt commands (https://docs.getdbt.com/reference/dbt-commands) on Snowflake:
- build (https://docs.getdbt.com/reference/commands/build)
- clean (https://docs.getdbt.com/reference/commands/clean)
- compile (https://docs.getdbt.com/reference/commands/compile)
- deps (https://docs.getdbt.com/reference/commands/deps)
- list (https://docs.getdbt.com/reference/commands/list)
- parse (https://docs.getdbt.com/reference/commands/parse)
- retry (https://docs.getdbt.com/reference/commands/retry)
- run (https://docs.getdbt.com/reference/commands/run)
- run-operation (https://docs.getdbt.com/reference/commands/run-operation)
- seed (https://docs.getdbt.com/reference/commands/seed)
- show (https://docs.getdbt.com/reference/commands/show)
- snapshot (https://docs.getdbt.com/reference/commands/snapshot)
- source freshness (https://docs.getdbt.com/reference/commands/source)
- test (https://docs.getdbt.com/reference/commands/test)
For more information about using dbt commands, see the dbt Command reference (https://docs.getdbt.com/reference/dbt-commands).
Examples¶
The following examples show how to invoke snow dbt execute. The NAME argument identifies the dbt project object you want to run.
-
Execute the
builddbt command using a fully qualified object name: -
Execute the
testdbt command, select a specific model subset, and override the dbt version for this run: -
Execute the
rundbt command with inline environment variable overrides for this run: -
Execute the
rundbt command, pullingDBT_-prefixed variables (excludingDBT_ENV_SECRET_*variables) from your shell environment:--env-varsapplies inlineDBT_-prefixed overrides for a single execution, and--use-shell-env-varspullsDBT_-prefixed shell variables into the run (excludingDBT_ENV_SECRET_*variables). To select an environment defined in the project’senv.ymlfile, add the--envflag. These flags require Snowflake CLI 3.21 or later. For more information, see Using SQL environment variables and private Git packages for dbt Projects on Snowflake. -
Run without writing generated target and log files back to the live version:
Place
--writebackor--no-writebackbefore the dbt command. If you omit the option, the execution uses the object’sDEFAULT_WRITEBACKsetting. For concurrent executions of the same dbt project object, Snowflake recommends--no-writebackwhen target and log artifacts don’t need to persist to the live version. Using--no-writebackavoids conflicts during concurrent executions by preventing writes to overlapping target and log directories. If writeback is required, use distinct, non-overlapping target and log directories for each execution. Snowflake continues to store per-query result artifacts regardless of the setting. For examples, see Run a dbt project object concurrently. -
Run only models that changed since the last successful production execution, along with their downstream dependencies:
SYSTEM$DBT_GET_LAST_SUCCESSFUL_RUN_TARGETreturns the manifest.json and run_results.json from most recent successful execution in the results folder of the production dbt project object. Thestatealias mounts it under./imports/state, which is the path passed to dbt with--state. For prerequisites and a complete Slim CI workflow, see Use dbt artifacts for Slim CI and defer to production.Repeat
--importto mount files from multiple locations. Each alias determines the directory name under./imports. Imports make files available only to that execution. They don’t permanently copy the files into the dbt project object’s live version. To copy files into or out of the live version, use snow dbt copy.
For more examples and workflow guidance, see Managing dbt Projects on Snowflake using Snowflake CLI.