Get dbt cloud job id inside a dbt macro

440 Views Asked by At

I'm trying to get the DBT_CLOUD_JOB_ID - as dbt_artifact seems to do (here):

{ set dbt_cloud_job_id = env_var('DBT_CLOUD_JOB_ID', '') %}
{{ log("LOG dbt_cloud_job_id: " ~ dbt_cloud_job_id) }}

Prints:

LOG dbt_cloud_job_id: 

But I'm not succeeding. It returns empty. is there a better way to get this dbt cloud job id or am I missing something here?

[EDIT]

The problem was a syntax error {% %}

{% set dbt_cloud_job_id = env_var('DBT_CLOUD_JOB_ID', '') %}
0

There are 0 best solutions below