Syntax
Whitespace, comments, keywords, literals, and other syntactic rules
WDL files are encoded in UTF-8, with no byte order mark (BOM).
§Whitespace
Whitespace may be used anywhere in a WDL document. Whitespace has no meaning in WDL, and is effectively ignored.
The following characters are treated as whitespace:
| Name | Dec | Hex |
|---|---|---|
| Space | 32 | \x20 |
| Tab | 9 | \x09 |
| CR | 13 | \x0D |
| LF | 10 | \x0A |
§Comments
Comments can be used to provide helpful information such as workflow usage, requirements, copyright, etc. A comment is prepended by # and can be placed at the start of a line or at the end of any line of WDL code. Any text following the # will be completely ignored by the execution engine, with one exception: within the command section, ALL text will be included in the evaluated script - even lines prepended by #.
There is no special syntax for multi-line comments - simply use a # at the start of each line.
Example: workflow_with_comments.wdl
# Comments are allowed before version
version 1.3
# This is how you
# write a long
# multiline
# comment
task task_with_comments {
input {
Int number # This comment comes after a variable declaration
}
# This comment will not be included within the command
command <<<
# This comment WILL be included within the command after it has been parsed
echo ~{number * 2}
>>>
output {
Int result = read_int(stdout())
}
requirements {
container: "ubuntu:latest"
}
}
workflow workflow_with_comments {
input {
Int number
}
# You can have comments anywhere in the workflow
call task_with_comments { number }
output { # You can also put comments after braces
Int result = task_with_comments.result
}
}Example input:
{
"workflow_with_comments.number": 1
}
Example output:
{
"workflow_with_comments.result": 2
}§Reserved Keywords
The following (case-sensitive) language keywords are reserved and cannot be used to name declarations, calls, tasks, workflows, import namespaces, struct types, or aliases.
Array
Boolean
Directory
File
Float
Int
Map
None
Object
Pair
String
alias
as
call
command
else
enum
false
hints
if
in
import
input
left
meta
object
output
parameter_meta
right
requirements
runtime
scatter
struct
task
then
true
version
workflow§Literals
Task and workflow inputs may be passed in from an external source, or they may be specified in the WDL document itself using literal values. Input, output, and other declaration values may also be constructed at runtime using expressions that consist of literals, identifiers (references to declarations or call outputs), built-in operators, and standard library functions.