We've moved!
For WDL questions, see the WDL specification and WDL docs.
For Cromwell questions, see the Cromwell docs and please post any issues on Github.

Variable set in workflow as workflow output


I am trying to set a File set within the workflow (File optional_output in example below) as the workflow output.

task atask {
  File? i
  output {
    File output_file = i

workflow w {
  File? optional_file
  File other_file

  if (defined(optional_file)) {
    call atask {
        i = optional_file

  File optional_ouput = if (defined(atask.output_file)) then select_first([atask.output_file]) else other_file

  output {
    File w.atask.output_file = optional_output

But I get a "Unable to load namespace from workflow: ERROR: Unexpected symbol (the . in w.atask.output_file)" and "Workflow input processing failed" error.

I think I can do something like the solution posted here https://gatkforums.broadinstitute.org/wdl/discussion/9810/dynamically-change-workflow-output-based-on-conditional but I'd like to avoid it if possible since I'd like to keep the workflow output type to be a File and also to be named specifically "w.atask.output_file".


Best Answer


  • ahakoneahakone Member, Broadie

    I wanted to maintain that naming convention because that's how the other outputs are formatted (e.g., btask.* becomes "btask.output_file": "gs://some_cloud_path") and another script runs through the outputs of the workflow. But it turned out that the script doesn't care about the naming convention so this solution works, thanks.

Sign In or Register to comment.