Use the collect operator to gather all the outputs produced by the upstream task and emit them as a sole output. Then use the resulting channel as input input for the process.
Channel.fromPath('reads/*_1.fq.gz').set { samples_ch }
process foo {
input:
file x from samples_ch
output:
file 'file.fq' into unzipped_ch
script:
"""
< $x zcat > file.fq
"""
}
process bar {
echo true
input:
file '*.fq' from unzipped_ch.collect()
"""
cat *.fq
"""
}