How can I pass job parameters to a dbt task?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 08:43 AM
I have a dbt task that will use dynamic parameters from the job: {"start_time": "{{job.start_time.[timestamp_ms]}}"}
My SQL is edited like this:
select 1 as id
union all
select null as id
union all
select {start_time} as id
This causes the task to fail. How can I pass the start_time parameter correctly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 12:39 PM
Hello @jabori,
Can you try using the var() function to see if it fix the issue?
select 1 as id
union all
select null as id
union all
select {{ var('start_time') }} as id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 12:41 PM
Also, you need to pass the parameters using the --vars flag like that:
dbt run --vars '{"start_time": "{{job.start_time.[timestamp_ms]}}"}'
You will need to modify the 3rd dbt command in your job.

