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

job id fetching in parent job

bricksuser
New Contributor

hi,

i want to fetch job id of child job which executes its own workflow ,
into parent job which executes its own workflow but depends on job child jobs job id?

how to do that?

1 ACCEPTED SOLUTION

Accepted Solutions

Anjali_j
Databricks Employee
Databricks Employee

Hello, 

Assuming a few things

  • The parent job triggers the child job programmatically
  • By "job id" I am assuming you mean the job run ID (the actual execution instance), not the static job definition ID.

 

Trigger the child job using jobs/runnow. The response will give you the child's run_id.

Optionally wait for the child job to finish, if the parent depends on it, using jobs/runs/get

View solution in original post

2 REPLIES 2

Anjali_j
Databricks Employee
Databricks Employee

Hello, 

Assuming a few things

  • The parent job triggers the child job programmatically
  • By "job id" I am assuming you mean the job run ID (the actual execution instance), not the static job definition ID.

 

Trigger the child job using jobs/runnow. The response will give you the child's run_id.

Optionally wait for the child job to finish, if the parent depends on it, using jobs/runs/get

saurabh18cs
Honored Contributor III

Hi @bricksuser 

looks like a common fan-out orchestration patter. your parent job should triger child job programatically and then capture maintain its run_id. you can use databricks jobs api endpoints to start child job.

Use POST /api/2.1/jobs/run-now or POST /api/2.1/jobs/runs/submit.