This document describes how to create and run a job that isn't scheduled until specific jobs have succeeded or failed. To learn more about job states, see Job creation and execution overview.
If you have a workload with varying resource requirements, consider using dependent jobs to create an automated chain of jobs that each use separate VMs. For example, separate the types of VMs used for low-demand operations (like data preparation) and compute-intensive operations (like data processing). By using dependent jobs to help optimize resource consumption, you can reduce costs and quota usage.
Before you begin
- If you haven't used Batch before, review Get started with Batch and enable Batch by completing the prerequisites for projects and users.
-
To get the permissions that you need to create a job, ask your administrator to grant you the following IAM roles:
- Batch Job Editor (
roles/batch.jobsEditor) on the project - Service Account User (
roles/iam.serviceAccountUser) on the job's service account, which by default is the default Compute Engine service account
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
- Batch Job Editor (
Restrictions
Dependent jobs have the following restrictions:
A dependent job can have up to four dependencies. Each dependency must contain a unique job name and one of the following required states: