<?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: Running child job under parent job using run_job_task in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/running-child-job-under-parent-job-using-run-job-task/m-p/102628#M41184</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/135150"&gt;@holychs&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;It is possible to do using &lt;STRONG&gt;lookup&lt;/STRONG&gt; in Databricks Asset Bundles.&lt;BR /&gt;You define the job id variable that finds id of the job based on its name and use this variable to specify job_id in the run_job_task. Here is the code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;variables:
  my_job_id:
    description: id of the job
    lookup:
      job: "my_job"

resources:
  jobs:
    my_job:
      name: my_job
      tasks:
        - task_key: my_task
          notebook_task:
            notebook_path: &amp;lt;notebook path&amp;gt;
          existing_cluster_id: "&amp;lt;cluster id&amp;gt;"
    
    parent_job:
      name: parent_job
      tasks:
        - task_key: run_child_job
          run_job_task:
            job_id: ${var.my_job_id}
            job_parameters:
              my_param_value: my_param_value
  
targets:
  dev:
    mode: development
    default: true
    workspace:
      host: &amp;lt;workspace url&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The above code correctly deployed a job:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filipniziol_0-1734600143129.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/13594iE696867975492DC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filipniziol_0-1734600143129.png" alt="filipniziol_0-1734600143129.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2024 09:22:32 GMT</pubDate>
    <dc:creator>filipniziol</dc:creator>
    <dc:date>2024-12-19T09:22:32Z</dc:date>
    <item>
      <title>Running child job under parent job using run_job_task</title>
      <link>https://community.databricks.com/t5/data-engineering/running-child-job-under-parent-job-using-run-job-task/m-p/102619#M41181</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;I am trying to call another job under a workflow job using run_job_task. Currently I am manually providing job_id of the child job. I want to know if there is any way to pass job_name instead of run_id. This will automate the deployment across multiple workspaces.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another workaround for me is to extract the job_id of the given job_name from the workspace and update it in the parent job yaml configuration during the deployment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using github action for this. Any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 07:56:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/running-child-job-under-parent-job-using-run-job-task/m-p/102619#M41181</guid>
      <dc:creator>holychs</dc:creator>
      <dc:date>2024-12-19T07:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running child job under parent job using run_job_task</title>
      <link>https://community.databricks.com/t5/data-engineering/running-child-job-under-parent-job-using-run-job-task/m-p/102628#M41184</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/135150"&gt;@holychs&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;It is possible to do using &lt;STRONG&gt;lookup&lt;/STRONG&gt; in Databricks Asset Bundles.&lt;BR /&gt;You define the job id variable that finds id of the job based on its name and use this variable to specify job_id in the run_job_task. Here is the code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;variables:
  my_job_id:
    description: id of the job
    lookup:
      job: "my_job"

resources:
  jobs:
    my_job:
      name: my_job
      tasks:
        - task_key: my_task
          notebook_task:
            notebook_path: &amp;lt;notebook path&amp;gt;
          existing_cluster_id: "&amp;lt;cluster id&amp;gt;"
    
    parent_job:
      name: parent_job
      tasks:
        - task_key: run_child_job
          run_job_task:
            job_id: ${var.my_job_id}
            job_parameters:
              my_param_value: my_param_value
  
targets:
  dev:
    mode: development
    default: true
    workspace:
      host: &amp;lt;workspace url&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The above code correctly deployed a job:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filipniziol_0-1734600143129.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/13594iE696867975492DC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filipniziol_0-1734600143129.png" alt="filipniziol_0-1734600143129.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 09:22:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/running-child-job-under-parent-job-using-run-job-task/m-p/102628#M41184</guid>
      <dc:creator>filipniziol</dc:creator>
      <dc:date>2024-12-19T09:22:32Z</dc:date>
    </item>
  </channel>
</rss>

