I've been using this method to rename files at the end of a step:


      processed_fastq_1:
        type: File
        outputBinding:
          glob: ${ return '**/' + inputs.fastq1.basename }
          outputEval: |
            ${
              self[0].basename = inputs.add_rg_SM + '_R1.fastq.gz';
              return self[0]
            }

But I'm not sure if this is an acceptable method. Should there be an intermediate step using python or calling to a script to rename files in the middle of a CWL workflow?
I would suggest adding a simple `mv` command to the end of the command line, via arguments, e.g.  

```  
arguments:  
  - position: 1000  
    shellQuote: false  
    valueFrom: ' && mv $(inputs.fastq1.basename) $(inputs.add_rg_SM)_R1.fastq.gz'  
```  
then you could just glob `$(inputs.add_rg_SM)_R1.fastq.gz`  

This way you don't create duplicate files, which would be the case when using a separate step. Also, other users using the tool can see that renaming is happening just by looking at the command-line.