Update: July 26, 2019
This section of the forum is now closed; we are working on a new support model for WDL that we will share here shortly. For Cromwell-specific issues, see the Cromwell docs and post questions on Github.

Namespaces

Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

Import statements can be used to pull in tasks/workflows from other locations as well as create namespaces. In the simplest case, an import statement adds the tasks/workflows that are imported into the current namespace. For example:

tasks.wdl

task x {
  command { python script.py }
}
task y {
  command { python script2.py }
}

workflow.wdl

import "tasks.wdl"

workflow wf {
  call x
  call y
}

Tasks x and y are in the same namespace as workflow wf is. However, if workflow.wdl could put all of those tasks behind a namespace:

workflow.wdl

import "tasks.wdl" as ns

workflow wf {
  call ns.x
  call ns.y
}

Now everything inside of tasks.wdl must be accessed through the namespace ns.

Each namespace contains: namespaces, tasks, and workflows. The names of these needs to be unique within that namespace. For example, there cannot be a task named foo and also a namespace named foo. Also there can't be a task and a workflow with the same names, or two workflows with the same name.

Sign In or Register to comment.