A task in your workflow is expected to not create an output file in some circumstances.
Declare such output as an optional
file.
process foo {
output:
path 'foo.txt', optional: true
script:
'''
touch foo.txt
'''
}
workflow {
foo()
}
Use the the following command to execute the example:
nextflow run nextflow-io/patterns/optional-output.nf