# Complex workflow cannot be packed

**URL:** <https://cwl.discourse.group/t/complex-workflow-cannot-be-packed/1022>\
**Category:** CWL Questions\
**Created:** [October 25, 2025, 10:30pm UTC](https://cwl.discourse.group/t/complex-workflow-cannot-be-packed/1022 "2025-10-25T22:30:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexiswl](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/alexiswl/32/93_2.png) [@alexiswl](https://cwl.discourse.group/u/alexiswl)\
**Post date:** [October 25, 2025, 10:30pm UTC](https://cwl.discourse.group/t/complex-workflow-cannot-be-packed/1022/1 "2025-10-25T22:30:30Z")

</div>

Hi team,

I have a workflow that generates invalid imports when packed.

From

[Release dragen-wgts-dna-pipeline/4.4.4\_\_20251009055750 · umccr/cwl-ica](https://github.com/umccr/cwl-ica/releases/tag/dragen-wgts-dna-pipeline%2F4.4.4__20251009055750)

I have a attached a copy of the zipped workflow and the subsequent packed workflow (compressed)

[dragen-wgts-dna-pipeline\_\_4.4.4\_\_20251009055750.zip](https://github.com/umccr/cwl-ica/releases/download/dragen-wgts-dna-pipeline%252F4.4.4 __20251009055750/dragen-wgts-dna-pipeline__ 4.4.4__20251009055750.zip)

[dragen-wgts-dna-pipeline\_\_4.4.4\_\_20251009055750.packed.cwl.json.gz](https://github.com/umccr/cwl-ica/releases/download/dragen-wgts-dna-pipeline%2F4.4.4 __20251009055750/dragen-wgts-dna-pipeline__ 4.4.4__20251009055750.packed.cwl.json.gz)

When packed, there are a lot of `“$import”: “#dragen-qc-coverage__1.0.0.yaml/dragen-qc-coverage”` but the actual schema is not defined anywhere.

Running

```auto
cwltool --validate \
  <( \
    wget -q -O- \
      "https://github.com/umccr/cwl-ica/releases/download/dragen-wgts-dna-pipeline%2F4.4.4 __20251009055750/dragen-wgts-dna-pipeline__ 4.4.4__20251009055750.packed.cwl.json.gz" | \
    zcat \
  )

```

Gives

```auto
ERROR Tool definition failed validation:
(139693097291072) (file:///proc/self/fd/11) Validation error in position 4:
  (139693097291072) (file:///proc/self/fd/11) Validation error in field requirements:
    (139693097291072) (file:///proc/self/fd/11) Validation error in position 1:
      (139693097291072) (file:///proc/self/fd/11) Validation error in field types:
        (139693097291072) (file:///proc/self/fd/11) Validation error in position 2:
          Reference '#dragen-qc-coverage__1.0.0.yaml/dragen-qc-coverage' not found in file 'file:///proc/self/fd/11'.

```

Implications of this are that I cannot make a nice graph describing the workflow or any of the subworkflows.

---

<div class="post-metadata">

**Author:** ![alexiswl](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/alexiswl/32/93_2.png) [@alexiswl](https://cwl.discourse.group/u/alexiswl)\
**Post date:** [October 25, 2025, 10:42pm UTC](https://cwl.discourse.group/t/complex-workflow-cannot-be-packed/1022/2 "2025-10-25T22:42:03Z")

</div>

On the contrary, I was able to make an update of the workflow that does pack correctly

Release: [Release dragen-wgts-dna-pipeline/4.4.4\_\_20251015010222 · umccr/cwl-ica · GitHub](https://github.com/umccr/cwl-ica/releases/tag/dragen-wgts-dna-pipeline%2F4.4.4__20251015010222)

Zipped: [dragen-wgts-dna-pipeline\_\_4.4.4\_\_20251015010222.zip](https://github.com/umccr/cwl-ica/releases/download/dragen-wgts-dna-pipeline%2F4.4.4 __20251015010222/dragen-wgts-dna-pipeline__ 4.4.4__20251015010222.zip)

Packed: [dragen-wgts-dna-pipeline\_\_4.4.4\_\_20251015010222.packed.cwl.json.gz](https://github.com/umccr/cwl-ica/releases/download/dragen-wgts-dna-pipeline%2F4.4.4 __20251015010222/dragen-wgts-dna-pipeline__ 4.4.4__20251015010222.packed.cwl.json.gz)

But when I run the non-packed version of this workflow through the ICAv2 Orchestration Engine I get the following errors:

```auto
schema_salad.avro.schema.SchemaParseException: The name "dragen-qc-coverage" is already in use.

```

Full error report can be found at: [Schema already in use error · Issue #2167 · common-workflow-language/cwltool](https://github.com/common-workflow-language/cwltool/issues/2167)

---

<div class="post-metadata">

**Author:** ![mrc](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/mrc/32/3_2.png) [@mrc](https://cwl.discourse.group/u/mrc)\
**Post date:** [October 26, 2025, 9:41am UTC](https://cwl.discourse.group/t/complex-workflow-cannot-be-packed/1022/3 "2025-10-26T09:41:49Z")

</div>

Which tool did the packing and what version of the tool is that?

How did you make your fix?

---

<div class="post-metadata">

**Author:** ![alexiswl](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/alexiswl/32/93_2.png) [@alexiswl](https://cwl.discourse.group/u/alexiswl)\
**Post date:** [October 26, 2025, 10:19pm UTC](https://cwl.discourse.group/t/complex-workflow-cannot-be-packed/1022/4 "2025-10-26T22:19:57Z")

</div>

> Which tool did the packing and what version of the tool is that?

Using `cwltool --pack` to pack the workflow with version 3.1.20250925164626

`sbpack` doesn’t work since it cannot handle the nested schema imports.

> How did you make your fix?

I was able to make the fix by ensuring there was at least one tool had the offending nested schema as a direct input (rather than a nested input). This involved making dummy tools and then using a `when: false` on the conditionals of that step so that the tool itself was never run.

It fixed the packing part, but it caused the schema parse exception shown in the GitHub issue [2167](https://github.com/common-workflow-language/cwltool/issues/2167#issuecomment-3448279076).
