Skip to main content

dbt Cloud - Trigger Job and Download Results to Shipyard

Overview​

A Vessel built with this Blueprint will kick off a single job on dbt Cloud and check for the status every 30 seconds. Once the status is confirmed to be completed, Shipyard will attempt to download all of the logs and artifacts.

The final status of this Vessel in Shipyard will reflect the status of the run in dbt Cloud.

The "cause" for an execution triggered via Shipyard will always contain the following details:

  • Fleet ID
  • Vessel ID
  • Vessel Log ID

Note: This is considered an "all-in-one" Blueprint for the other 3 dbt Cloud Blueprints. By using this Blueprint, you will accumulate runtime as the Vessel continuously waits for the job to be completed. The tradeoff is that results may be quicker and the setup/complexity is less.

If you want to reduce the overall runtime you're billed for, you will need to instead set up a Fleet with Vessels built with these blueprints in this order:

Execute Job -> Check Run Status -> Download Artifacts & Logs

Variables​

NameReferenceTypeRequiredDefaultOptionsDescription
Service TokenDBT_API_KEYPasswordβœ…--Your unique service token for dbt Cloud. Instructions for how to get this token can be found in the authorization documentation.
Account IDDBT_ACCOUNT_IDAlphanumericβœ…--Your unique Account ID, found in the URL of dbt Cloud. https://cloud.getdbt.com/#/accounts/ACCOUNT_ID/projects/PROJECT_ID/dashboard/
Job IDDBT_JOB_IDAlphanumericβœ…--The ID of a specific job you want to run, found in the URL of dbt Cloud. https://cloud.getdbt.com/#/accounts/ACCOUNT_ID/projects/PROJECT_ID/jobs/JOB_ID/
Download Artifacts?DBT_DOWNLOAD_ARTIFACTSBooleanβœ…"true"-Determines if the artifacts from the run that was generated will be downloaded. Checked by default.
Download Logs?DBT_DOWNLOAD_LOGSBooleanβœ…"true"-Determines if the logs from the run that was generated will be downloaded. Checked by default.

YAML​

Below is the YAML template for this Blueprint and can be used in the Fleet YAML Editor.

source:
blueprint: dbt Cloud - Trigger Job and Download Results to Shipyard
inputs:
DBT_API_KEY: null ## REQUIRED
DBT_ACCOUNT_ID: null ## REQUIRED
DBT_JOB_ID: null ## REQUIRED
DBT_DOWNLOAD_ARTIFACTS: '"true"' ## REQUIRED
DBT_DOWNLOAD_LOGS: '"true"' ## REQUIRED
type: BLUEPRINT
guardrails:
retry_count: 1
retry_wait: 0h0m0s
runtime_cutoff: 1h0m0s
exclude_exit_code_ranges:
- '200'
- '201'
- '211'
- '212'