common-workflow-language / common-workflow-language/cwltool
'main/' added when 'id' not present in workflow outputs
- Dominant language
- Python
- Stars
- 376
- Forks
- 255
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 12
Description
## Expected Behavior
`id` should not play a role in determining the name of an output when workflow is 'packed'
## Actual Behavior
With a packed workflow, if `id` is set, outputs of the workflow do NOT have the prefix main.
If `id` is NOT set, outputs of the workflow do have the prefix main
## Workflow Code
from [https://github.com/common-workflow-language/cwl-v1.1/blob/main/tests/count-lines1-wf.cwl](https://github.com/common-workflow-language/cwl-v1.1/blob/main/tests/count-lines1-wf.cwl)
```yaml
#!/usr/bin/env cwl-runner
class: Workflow
cwlVersion: v1.1
inputs:
file1:
type: File
outputs:
count_output:
type: int
outputSource: step2/output
steps:
step1:
run: wc-tool.cwl
in:
file1: file1
out: [output]
step2:
run: parseInt-tool.cwl
in:
file1: step1/output
out: [output]
```
## Now let's pack it and then check on the outputs
```bash
cwltool --pack count-lines1-wf.cwl | jq '.["$graph"][] | select(.class == "Workflow") | .outputs[] | .id'
```
Yields
```
"#main/count_output"
```
## Now let's add the id attribute to the workflow
```yaml
#!/usr/bin/env cwl-runner
class: Workflow
cwlVersion: v1.1
id: count-lines-1-wf
inputs:
file1:
type: File
outputs:
count_output:
type: int
outputSource: step2/output
steps:
step1:
run: wc-tool.cwl
in:
file1: file1
out: [output]
step2:
run: parseInt-tool.cwl
in:
file1: step1/output
out: [output]
```
We run the same command again:
```bash
cwltool --pack count-lines1-wf.cwl | jq '.["$graph"][] | select(.class == "Workflow") | .outputs[] | .id'
```
and get
```
"#count_output"
```
Contributor guide
Assessment
This issue has not been assessed yet.