Job Dependencies

See Also: Multi-Step Jobs

Jobs can be linked together in three ways:

These two approaches can be combined to produce any job flow you need.

Example

This example provides an illustration of a simple scenario in which one job starts a subsidiary job, and then waits for it to finish.

Scenario: You need to automate the nightly update of your organization's data warehouse. This involves several different steps:

  1. Download a data file using FTP.
  2. Load the downloaded data into the data warehouse.
  3. Extract data from a local database and copy it to the data warehouse.
  4. Run the process that reprocesses the data warehouse and rebuilds the data cubes.

Diagram illustrating job dependencies

The tasks have the following dependencies:

  • Task 2 must follow task 1.
  • Task 3 can execute independently of tasks 1 and 2.
  • Task 4 must follow tasks 2 and 3.

Since tasks 1, 2, and 4 always run together, they can be grouped as separate steps in a single job. Since task 3 is not dependent on tasks 1 and 2, it makes sense to have it execute concurrently with tasks 1 and 2—there's no need to wait until they're finished.

So Task 3 is put in a separate job, linked to the main job as follows:

  • An action attached to the "Job Start" event on the main job starts the local extraction job. That is, whenever the main job is started, the second job is started as well.
  • Step 3 of the main job does the data warehouse reprocessing (Task 4 above). Step 3 will be automatically started once Step 2 (which imports the downloaded data) completes. However, you need for Step 3 to wait until the local data extract (executing in the secondary job) completes. So you add a Job Condition to Step 3, causing it to wait until the secondary job completes.

Diagram illustrating job flow