Define dependencies between elements in job arrays
Use the Trigger the element with the same index in the next job array dependency type to specify dependencies between elements in job arrays.
About this task
In some cases, you might have a job array that depends on another job array but you want the next job array to start as soon as the first element of the first job array finishes. For example, job array A2 depends on job array A1. Each element in job array A2 can start as soon as the corresponding element of job array A1 is finished.
You can define job array element-to-element dependency with the Trigger the element with the same index in the next job array dependency definition.
- The job arrays must have the same number of elements.
- The first job array must be connected to the next job array with a dependency arrow directly, or with a dependency arrow with an AND.
- In the Flow Editor, draw a dependency arrow between one job array and the next job array.
Right-click the dependency arrow and choose Open Definition.
The Job Array Event Definition dialog is displayed.
In the Event type field, select Trigger the element with the
same index in the next job array, and choose the criteria.
Note: If you select An element completes successfully as the criteria, if any element in the first job array fails, the element with the same index in the next job array remains in the PEND state and the status of the second job array always remains Running. To prevent this issue, right-click the dependency and select Flow Completion Attributes. Under When any work item fails, select Stop the flow and kill any running work items.
- Click OK to save your changes.