Handling optional outputs

Post author
matan

How would one implement optional File output in a task? For example an output file that is only created if a particular option is specified?

A simple and ugly workaround is to create an empty dummy file. Any other ideas?

I can specify the following:


    output {
           File a = "a.txt"
           File? b = "b.txt"
    }

However it results in an error if "b.txt" does not exist. 

Comments

1 comment

  • Comment author
    Jason Cerrato

    Hi Matan,

     

    At this time, Cromwell doesn't support option file output in a task. This has been on the feature request list for some time now (see: https://github.com/openwdl/wdl/issues/20).

    However, this change is slated for the WDL v2.0 release (see: https://github.com/openwdl/wdl/pull/310).

    For now, you will need to use the workaround as you described it—creating an empty dummy file. If you have any questions, please let us know.

     

    Kind regards,

    Jason

    0

Please sign in to leave a comment.