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

start another workflow waiting the completion of a job-run of the same workflow

jeremy98
New Contributor

Hello community,
I'm using DABs I want to know if It is possible to configure the yaml file a logic that allows me to run a workflow if the previous job run is finished of the same workflow. Is it possible to do it? Do I need to create a task that checks this job execution?

Thanks to everyone,

2 REPLIES 2

Alberto_Umana
Databricks Employee
Databricks Employee

Hello @jeremy98,

Yes, it is possible to configure a YAML file to run a workflow only if the previous job run of the same workflow has finished. You can achieve this by defining dependencies between tasks within the workflow.

You can specify task dependencies using the depends_on field in your YAML configuration. This ensures that a task will only run after the specified dependent tasks have completed successfully

 

Example code:

 

bundle:

  name: example-bundle

resources:

  jobs:

    example-job:

      name: example-job

      tasks:

        - task_key: task1

          notebook_task:

            notebook_path: /path/to/notebook1

        - task_key: task2

          depends_on:

            - task_key: task1

          notebook_task:

            notebook_path: /path/to/notebook2

 

Please see: https://github.com/databricks/bundle-examples/blob/6558a732f4f21e2de7440aa0aadfd9ed8f845395/default_...

Thanks @Alberto_Umana  for this solution, but I mean I need to execute only one notebook task in the job, so the depends_on isn't possible to set. Do u mean that I need to create a first task that is a check_monitoring_job that checks if any other job is still running and later when it is finished execute the last one (my interested ingestion 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