Directory files paths to Array

I’m new to CWL and need some help.

Input: Directory with *fastq.qz files
Output: An Array with file_paths OR Array of Files (this will be used in the second process to scatter through them)

Only got so far that I can print the content of the Directory with this code below:

cwlVersion: v1.0
class: CommandLineTool
baseCommand: ls
stdout: output.txt
inputs:
  dir:
    type: Directory
    inputBinding:
      position: 1
outputs:
  example_out:
    type: stdout

Hello @geig3,
If you want to scatter over the files from the given directory, in your case dir, then you have to pass this as an array of files like File[].

inputs:
  dir:
    type: File[]

Then use this input directly in your sub-workflow to scatter.

scatter: in_file
  in:
    in_file: dir

Hope it helps!