<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get job run_id of run_job_task in an orchestration job in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/get-job-run-id-of-run-job-task-in-an-orchestration-job/m-p/94839#M38978</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/127899"&gt;@MihaiTache&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;It seems you have found the answer. Do you need any other help?&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2024 11:47:58 GMT</pubDate>
    <dc:creator>filipniziol</dc:creator>
    <dc:date>2024-10-18T11:47:58Z</dc:date>
    <item>
      <title>Get job run_id of run_job_task in an orchestration job</title>
      <link>https://community.databricks.com/t5/data-engineering/get-job-run-id-of-run-job-task-in-an-orchestration-job/m-p/94803#M38971</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a Databricks job which orchestrates the run of two jobs: job1 and job2 using&amp;nbsp;run_job_task.&lt;/P&gt;&lt;P&gt;job2 depends on job1 and would need to use the run_id of job1 as a parameter. How can this be done?&lt;/P&gt;&lt;P&gt;I see that you can only easily access the task run id of the job&amp;nbsp;{{tasks.job1.run_id}}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 10:25:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/get-job-run-id-of-run-job-task-in-an-orchestration-job/m-p/94803#M38971</guid>
      <dc:creator>MihaiTache</dc:creator>
      <dc:date>2024-10-18T10:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get job run_id of run_job_task in an orchestration job</title>
      <link>https://community.databricks.com/t5/data-engineering/get-job-run-id-of-run-job-task-in-an-orchestration-job/m-p/94839#M38978</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/127899"&gt;@MihaiTache&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;It seems you have found the answer. Do you need any other help?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 11:47:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/get-job-run-id-of-run-job-task-in-an-orchestration-job/m-p/94839#M38978</guid>
      <dc:creator>filipniziol</dc:creator>
      <dc:date>2024-10-18T11:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get job run_id of run_job_task in an orchestration job</title>
      <link>https://community.databricks.com/t5/data-engineering/get-job-run-id-of-run-job-task-in-an-orchestration-job/m-p/94850#M38980</link>
      <description>&lt;P&gt;&lt;SPAN&gt;{{tasks.job1.run_id}} provides the &lt;STRONG&gt;task run_id&lt;/STRONG&gt;&amp;nbsp;of the task under which job1 is run. What I'm looking for is the actual &lt;STRONG&gt;job run_id&lt;/STRONG&gt; of job1, which doesn't seem available at first glance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 12:03:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/get-job-run-id-of-run-job-task-in-an-orchestration-job/m-p/94850#M38980</guid>
      <dc:creator>MihaiTache</dc:creator>
      <dc:date>2024-10-18T12:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get job run_id of run_job_task in an orchestration job</title>
      <link>https://community.databricks.com/t5/data-engineering/get-job-run-id-of-run-job-task-in-an-orchestration-job/m-p/94866#M38985</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/127899"&gt;@MihaiTache&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;thank you for clarification.&lt;BR /&gt;As per documentation this value reference is not available out-of-the-box:&lt;BR /&gt;&lt;A href="https://docs.databricks.com/en/jobs/dynamic-value-references.html?searchString=#supported-value-references" target="_blank"&gt;What is a dynamic value reference? | Databricks on AWS&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;A workaround is to use shared location available for 2 jobs.&lt;BR /&gt;As part of job1 you would store its value and job2 would read the saved value from shared location.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 12:31:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/get-job-run-id-of-run-job-task-in-an-orchestration-job/m-p/94866#M38985</guid>
      <dc:creator>filipniziol</dc:creator>
      <dc:date>2024-10-18T12:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get job run_id of run_job_task in an orchestration job</title>
      <link>https://community.databricks.com/t5/data-engineering/get-job-run-id-of-run-job-task-in-an-orchestration-job/m-p/94898#M38990</link>
      <description>&lt;DIV&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/127899"&gt;@MihaiTache&lt;/a&gt;&amp;nbsp;You can achieve this by utilizing a combination of &lt;STRONG&gt;dbutils.widgets.get and dbutils.jobs.taskValues.set&lt;/STRONG&gt;. The approach involves extracting the run_id from Job1 and passing it as a value to Job2 using taskValues.set. This allows seamless communication between jobs within a workflow, enabling Job2 to access information or outputs from Job1 efficiently.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;In Job1:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Extract necessary values (e.g., run_id) using dbutils.widgets.get to retrieve any required parameters passed to the job.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Use dbutils.jobs.taskValues.set to store and make the value available for subsequent jobs.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;In Job2:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Retrieve the value set by Job1 using dbutils.jobs.taskValues.get. This ensures Job2 starts with the required context, such as Job1’s run_id or other task-related values.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;Job1 &amp;amp; Job 2 Setup screenshots: Review the attachment&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;Job1 Notebook:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;job1_run_id = dbutils.widgets.get("job1_run_id")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.jobs.taskValues.set("job1_run_id", job1_run_id)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;Job2 Notebook:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;extract_job1_run_id = dbutils.widgets.get("extract_job1_run_id")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;print(f"Received extract_job1_run_id: {extract_job1_run_id}")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 14:57:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/get-job-run-id-of-run-job-task-in-an-orchestration-job/m-p/94898#M38990</guid>
      <dc:creator>Panda</dc:creator>
      <dc:date>2024-10-18T14:57:48Z</dc:date>
    </item>
  </channel>
</rss>

