}
/** Helper function to parse workflow from a generic {@link Reader} */
private static Workflow parse(Reader reader) throws Exception {
Yaml yaml = new Yaml(new Constructor(WorkflowBean.class));
WorkflowBean wf = (WorkflowBean) yaml.load(reader);
Builder builder = new Builder(wf.name);
for (JobBean job : wf.jobs) {
if (job.name == null) {
throw new IllegalArgumentException("A job must have a name.");