Validate syntax

Kate Herman

This article is now archived.

WDL articles now live in the openwdl/wdl-docs GitHub repository. Find the updated documentation on the wdl-docs website.

Nobody likes to kick off a bunch of jobs only to find after returning from lunch that they all failed within minutes due to a syntax error in the script. Missing bracket, schmacket.

The good news is that WDL comes with a utility toolkit called wdltool that includes a syntax validation function. Instructions for getting and running the wdltool executable are here (but don't worry about it now -- we'll give you that link again when it's time to install everything you need).

To validate our WDL syntax, we simply call the validate function on our script:

$ java -jar wdltool.jar validate myWorkflow.wdl

This function parses the WDL script and alerts us to any syntax errors such missing curly braces, undefined variables, missing commas and so on. It will resolve imports, but note that it is not able to identify errors like typos in commands, specifying the wrong filename, or failing to provide required inputs to the programs that are run in the workflow.

Example: error if a call references a task that doesn't exist:

$ java -jar wdltool.jar validate myWorkflow.wdl
ERROR: Call references a task (BADps) that doesn't exist (line 22, col 8)

  call BADps

Once we've fixed any syntax errors, we're almost ready to run our script! Just one more step stands between us and execution. Um. That's a little worrying, isn't it? Maybe we could rephrase that? Sure. Just one more step between us and nirvana. No that's not better. OK, just one more step between us and the satisfaction of a well-written WDL script running smoothly on our preferred execution engine. Yeah alright let's go with that.

Go to the next section: Specify Inputs.

Was this article helpful?

2 out of 2 found this helpful


1 comment

  • Comment author
    Lon Blauvelt

    I believe WDLtool is now called WOMtool and it lives under the Cromwell repository.


Please sign in to leave a comment.