How to test workflows locally

Allie Hajian

When creating WDL workflows, you can test on a local installation of the Cromwell execution engine prior to uploading and testing in Terra. Cromwell is the workflow execution service used to run and test WDL workflows.

For step-by-step instructions, see the Five minute introduction to Cromwell tutorial. 

What is Cromwell?
Cromwell is a Java workflow management application that requires the Java 11 cloud environment. 
Cromwell is developed, tested, and containerized using AdoptOpenJDK 11 HotSpot.

You will need to install the Java 11 Developer Kit if you do not already have it. Note that you should install the JDK, not the cloud environment or JRE.

Why use Java Development Kit packages?We point to the “JDK” (Java Development Kit) packages because they are the most complete Java packages (suitable for developing in Java as well as running Java executables), and we have had reports that the “JRE” (Java Runtime Environment) equivalents were not sufficient to run GATK on some machines.

You must also download Docker for Cromwell to work. Installation instructions can be found here.

After ensuring you have Java 11 installed on your laptop, download the latest Cromwell jar here.

To test that your environment works, try running the HelloWorld WDL below. You don't need an inputs file to run this workflow, and the output should be Hello World written in the stdout file.

workflow HelloWorld {

    call WriteGreeting
}

task WriteGreeting {

    command {
        echo "Hello World"
    }
    output {
        File outfile = stdout()
    }
}

Once you verify that you can run WDLs locally, you can develop and test WDLS of any length on your own machine, before uploading to the Broad methods Repository or Dockstore to share and use on Terra. 

Was this article helpful?

0 out of 1 found this helpful

Have more questions? Submit a request

Comments

4 comments

  • Comment author
    Peter van Galen

    Hi,

    To illustrate how new I am to this, until yesterday I had never heard of cromwell. That being said, I am developing a workflow, and would like to test it locally. After I download the latest Cromwell jar (cromwell-72.jar), what do I do? Do I need to install it somehow?

    How exactly can I "run" the HelloWorld WDL?

    Thank you,

    Peter

    0
  • Comment author
    Peter van Galen

    * I found the answer to my questions here: https://cromwell.readthedocs.io/en/stable/tutorials/FiveMinuteIntro/

    0
  • Comment author
    Andrew Davidson

    Documentation is incomplete. Please add the link Peter mentioned

    0
  • Comment author
    Allie Cliffe

    Andrew Davidson Thanks for the heads up! I added the link and updated some of the other information in the article as well. Hopefully it's more complete!

    0

Please sign in to leave a comment.