This blog explains how to create multiple jobs using an array and define a final job that depends on the previous loop jobs.
The following is the first YAML template file ( deploystage.yaml) with stages. Under the jobs section, it includes two templates. The first template is called within a loop, creating multiple jobs.