Why is only one workflow allowed?

I'm busy moving shared code into a lib.wdl file, that I can then import into different workflows. In that file, I organised different tasks into separate workflows, eg workflow assemble {...}, workflow trimReads {...} etc.
However, when I try to validate the wdl file I get this error:

$ wdltool validate lib.wdl 
ERROR: Only one workflow definition allowed, found 2 workflows:

Prior workflow definition (line 86 col 10):

workflow assemble {
         ^

Prior workflow definition (line 152 col 10):

workflow trim {
         ^

Are there any plans to allow this in the near future? A user would never run lib.wdl directly in cromwell, so that would not cause a problem. But I also think it make sense to have cromwell run each workflow in a .wdl file when multiple workflows are defined.

Best Answer

Answers

  • RuchiRuchi Member, Broadie, Moderator, Dev admin

    Hey Redmar_van_den_Berg, as of right now, there aren't any plans to build this functionality in the near future. Currently, you are onlly able to create a library of tasks in a WDL file, and then those can be re-used to compose a WDL.

    You can alternatively create a lib.wdl workflow file, which imports assemble.wdl and trim.wdl. Then the outer-most workflow can import lib.wdl, which will give the outer-most workflow access to the workflows assemble and trim through the lib.wdl.

  • @Ruchi
    That sadly won't work, since assemble.wdl needs access to trim.wdl as well. And when I define that, you have a circular import and wdltool crashes. So in assemble.wdl, I have to import trim.wdl directly instead of via the shared.wdl library, which defeats the whole purpose.

Sign In or Register to comment.