Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 438 Bytes

optional-output.md

File metadata and controls

33 lines (23 loc) · 438 Bytes

Problem

A task in your workflow is expected to not create an output file in some circumstances.

Solution

Declare such output as an optional file.

Code

process foo {
  output: 
  path 'foo.txt', optional: true

  script:
  '''
  touch foo.txt
  '''
}

workflow {
  foo()
}

Run it

Use the the following command to execute the example:

nextflow run nextflow-io/patterns/optional-output.nf