Grouping outputs into separate directories

Is there a straightforward way to group outputs from specific steps into different output directories? For example, say my workflow is something like trim → align → call variants → qc. I would like to group the results (and possibly intermediates) from each of those steps into separate directories with a structure like:

trim
    - SAMPLE-ID
        - Fastq1
        - Fastq2
alignment
    - SAMPLE-ID
        - Final bam
        - Intermediate bam
vc
    - SAMPLE-ID
        - Final VCF
        - Intermediate VCF
qc
    - SAMPLE-ID
        - Trim QC report
        - Align QC report
        - Variant QC report

I’m aware of the --leave-outputs option but that isn’t quite what I want. I’m transitioning from Nextflow to CWL and this output structure is very simple to achieve in Nextflow. I’m wondering if I’m overlooking some documentation for CWL that discusses this.