Is the order of outputs after a scatter guaranteed?

Is it guaranteed that the output arrays will be in the same order as the input arrays after a dotproduct scatter?

If I run something like:

scatter: [bam, samplename]
scatterMethod: dotproduct
run: mytool.cwl
        in:
            bam: bams
            samplename: samplenames
        out:
            [outfiles]

Is it guaranteed that outfiles have a 1-to-1 correspondence with the bam/samplename arrays? That is, will the first outfile be from the first bam/samplename, the second outfile from the second pair of inputs, etc?

Edit: Forgot to add that the spec seems to say that with nested_crossproduct and flat_crossproduct the outputs will be ordered, but does not specify output order for dotproduct https://www.commonwl.org/v1.0/Workflow.html#WorkflowStep

1 Like

Short answer: yes, the output order is the same as the input order.

Slightly longer answer: I can’t remember if it is stated explicitly in the specification (it probably should be, if it isn’t) but passing conformance tests almost certainly assumes it is the case.