"class": "Workflow",
"cwlVersion": "v1.2",
"id": "workflow.cwl",
"inputs": [],
"outputs": [
{
"id": "output1",
"outputSource": "one/output",
"type": "File"
},
{
"id": "output2",
"outputSource": "two/output",
"type": "File"
}
],
"requirements": [
{
"class": "SubworkflowFeatureRequirement"
}
],
"steps": [
{
"id": "one",
"in": [],
"out": [
"output"
],
"run": {
"baseCommand": [
"bash",
"-c",
"echo something > output"
],
"class": "CommandLineTool",
"cwlVersion": "v1.2",
"id": "workflow.cwl@step_one@one.cwl",
"inputs": [],
"outputs": [
{
"id": "output",
"outputBinding": {
"glob": "output"
},
"type": "File"
}
],
"requirements": []
}
},
{
"id": "two",
"in": [],
"out": [
"output"
],
"run": {
"class": "Workflow",
"cwlVersion": "v1.2",
"id": "workflow.cwl@step_two@two_wrapper.cwl",
"inputs": [],
"outputs": [
{
"id": "output",
"outputSource": "two/output",
"type": "File"
}
],
"requirements": [],
"steps": [
{
"id": "two",
"in": [],
"out": [
"output"
],
"run": {
"baseCommand": [
"bash",
"-c",
"echo something > output"
],
"class": "CommandLineTool",
"cwlVersion": "v1.2",
"id": "two_wrapper.cwl@step_two@two.cwl",
"inputs": [],
"outputs": [
{
"id": "output",
"outputBinding": {
"glob": "output"
},
"type": [
"null",
"File"
]
}
],
"requirements": []
}
}
]
}
}
]
}
If you have a workflow as follows:
one.cwl:two_wrapper.cwl:two.cwl:`cwlpack` workflow
This generates the following applets:

Note: there are two
outputsapplets, the innerworkflow_cwl_step_two_two_wrapper_cwl_outputsapplet created bytwo_wrapper.cwlnarrowing the output type fromFile?intwo.cwltoFileintwo_wrapper.cwl.When running this, two_wrapper's

outputsstep fails as seen below:with the error message:
implying that it's trying to collect outputs for the entire workflow, not the
twoworkflow.I've had a bit of a delve into the dxCompiler source code to see what might be going on. My theory is that:
workflowproperty in theCwlWorkflowExecutorclass here:https://github.com/dnanexus/dxCompiler/blob/develop/executorCwl/src/main/scala/dx/executor/cwl/CwlWorkflowExecutor.scala#L271
CwlWorkflowExecutor.createfunction. In this function, the following bit of code executes this to find the appropriate workflow:https://github.com/dnanexus/dxCompiler/blob/develop/executorCwl/src/main/scala/dx/executor/cwl/CwlWorkflowExecutor.scala#L78-L82
OriginalNameof the outputs applet is"${wfName}_outputs", as can be seen here:https://github.com/dnanexus/dxCompiler/blob/develop/compiler/src/main/scala/dx/translator/cwl/ProcessTranslator.scala#L748
CwlWorkflowExecutor.createtherefore follows:https://github.com/dnanexus/dxCompiler/blob/develop/executorCwl/src/main/scala/dx/executor/cwl/CwlWorkflowExecutor.scala#L98-L103
and considers the wrong workflow