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:ย 

Workflow - How to find the task id at run time in current notebook

rameshybr
New Contributor II

There are four tasks in the workflow. How can I get the task ID at the beginning of the notebook, store it after finishing all the code cells in the notebook, and then save it into a table?

3 REPLIES 3

szymon_dybczak
Contributor III

Hi @rameshybr ,

You can use dynamic value references, specifically 

{{task.run_id}}

The unique identifier of the current task run.

Pass context about job runs into job tasks | Databricks on AWS

rameshybr
New Contributor II

How to use in note book cell ?

can you please describe in details pls.

menotron
Valued Contributor

Hi @rameshybr,

You can capture these as parameters in the task configuration.menotron_1-1723960911058.png

And from within the notebook you could use the widget utils to get their values.menotron_2-1723961287481.png

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