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?
Hello ionox0,

That is acceptable way to rename, yes. However, `**` is not part of the POSIX glob definition, so you'll need to amend that. Perhaps the following simplification works with your tool?

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

It has been requested that there be an easier way to rename output `File`s but there is no proposed new syntax yet. Perhaps you have a suggestion?

https://github.com/common-workflow-language/common-workflow-language/issues/668

The same link shows how to rename a `File` between steps.
