How to get the run_id from a previous task in a Databricks jobs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 02:45 PM
Hi, is there any way to share the run_id from a task_A to a task_B within the same job when task_A is a dbt task?
- Labels:
-
Databricks jobs
-
Task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 10:49 PM
Hi, You can pass {job_id}} and {{run_id}} in Job arguments and print that information and save into wherever it is needed
please find below the documentation for the same:
https://docs.databricks.com/data-engineering/jobs/jobs.html#task-parameter-variables
{{job_id}}
The unique identifier assigned to a job
1276862
{{run_id}}
The unique identifier assigned to a job run
3447843
{{parent_run_id}}
The unique identifier assigned to the run of a job with multiple tasks.
3447835
{{task_key}}
The unique name assigned to a task that’s part of a job with multiple tasks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 09:39 AM
I've tried this but it gets the id for the current task
![](/skins/images/B38AF44D4BD6CE643D2A527BE673CCF6/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/B38AF44D4BD6CE643D2A527BE673CCF6/responsive_peak/images/icon_anonymous_message.png)