cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to get the run_id from a previous task in a Databricks jobs

mmenjivar
New Contributor II

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?

2 REPLIES 2

Debayan
Databricks Employee
Databricks Employee

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.

mmenjivar
New Contributor II

I've tried this but it gets the id for the current task

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group