# Default value for a \`type: File\` with \`secondaryFiles\`

**URL:** <https://cwl.discourse.group/t/default-value-for-a-type-file-with-secondaryfiles/1031>\
**Category:** CWL Questions\
**Created:** [February 13, 2026, 9:12am UTC](https://cwl.discourse.group/t/default-value-for-a-type-file-with-secondaryfiles/1031 "2026-02-13T09:12:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stikus](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/stikus/32/463_2.png) [@Stikus](https://cwl.discourse.group/u/Stikus)\
**Post date:** [February 13, 2026, 9:12am UTC](https://cwl.discourse.group/t/default-value-for-a-type-file-with-secondaryfiles/1031/1 "2026-02-13T09:12:35Z")

</div>

Hello, I’m trying to set default file input for workflow step, but with secondaryFiles.

For now I’ve achieved working example without secondary (.tbi), but cannot fix this problem.

Working example:

```auto
steps:
  - id: S_vep
    in:
      - id: gdb
        default:
          class: File
          location: /mnt/gdb.vcf.gz

```

Tool part:

```auto
  - id: gdb
    type: File?
    inputBinding:
      position: 22
      prefix: --gdb
    secondaryFiles: [.tbi]

```

This results an error:

```auto
[workflow] starting step S_vep
[step S_vep] start
Exception on step 'S_vep'.[0m
[step S_vep] Cannot make job: cwl_schema.yml:243:5: Missing required secondary file 'gdb.vcf.gz.tbi' from file object: {
cwl_schema.yml:243:5: "class": "File",
cwl_schema.yml:243:5: "location": "file:///mnt/gdb.vcf.gz",
cwl_schema.yml:243:5: "basename": "gdb.vcf.gz",
cwl_schema.yml:243:5: "nameroot": "gdb.vcf",
cwl_schema.yml:243:5: "nameext": ".gz",
cwl_schema.yml:243:5: "size": 620,
cwl_schema.yml:243:5: "secondaryFiles": []
cwl_schema.yml:243:5: }.[0m
INFO.[0m [workflow] completed permanentFail

```

I assume that the reason is missing secondaryFiles in workflow input, but if I add some - I’ve got more errors:

Variant 1:

```auto
steps:
  - id: S_vep
    in:
      - id: gdb
        default:
          class: File
          location: /mnt/gdb.vcf.gz
          secondaryFiles: [.tbi]

```

Error 1:

```auto
INFO.[0m [workflow] starting step S_vep
INFO.[0m [step S_vep] start
ERROR.[0m .[31mException on step 'S_vep'.[0m
ERROR.[0m .[31m[step S_vep] Cannot make job: Invalid job input record:
the 'gdb' field is not valid because
cwl:133:11: the
              'secondaryFiles'
              field is not valid
              because
                tried array of
                <File or Directory>
                but
cwl:133:28: item is
                  invalid because
                    - tried
                    File but
                      Missing
                      'class' field
                    - tried
                    Directory but
                      Missing
                      'class' field.[0m
INFO.[0m [workflow] completed permanentFail

```

Variant 2:

```auto
steps:
  - id: S_vep
    in:
      - id: gdb
        default:
          class: File
          location: /mnt/gdb.vcf.gz
        secondaryFiles: [.tbi]

```

Error 2:

```auto
ERROR. Tool definition failed validation:
cwl:1:1: Object
           'cwl'
           is not valid because
             tried 'Workflow'
             but
cwl:99:1: the 'steps'
               field is not valid
               because
                 tried array
                 of <WorkflowStep>
                 but
cwl:100:5: item is
                   invalid because
cwl:101:5: the 'in'
                     field is not valid
                     because
cwl:129:9: item is
                       invalid because
cwl:133:9:
                         invalid field
                         'secondaryFiles',
                         expected one of:
                         'source',
                         'linkMerge', 'id',
                         'default',
                         'valueFrom'.

```

---

<div class="post-metadata">

**Author:** ![Stikus](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/stikus/32/463_2.png) [@Stikus](https://cwl.discourse.group/u/Stikus)\
**Post date:** [February 13, 2026, 9:37am UTC](https://cwl.discourse.group/t/default-value-for-a-type-file-with-secondaryfiles/1031/2 "2026-02-13T09:37:43Z")

</div>

@mrc I’ve found workaround:

```auto
inputs:
  - id: WFI_gdb
    type: File
    default:
      class: File
      location: /mnt/gdb.vcf.gz
    secondaryFiles: [.tbi]
steps:
  - id: S_vep
    in:
      - id: gdb
        source: WFI_gdb

```

But still interested in solution inside workflow step (without workflow input).

---

<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:** [February 18, 2026, 9:43am UTC](https://cwl.discourse.group/t/default-value-for-a-type-file-with-secondaryfiles/1031/3 "2026-02-18T09:43:25Z")

</div>

Hello @Stikus .

The issue is the difference between specifying `secondaryFiles` on an input parameter (which uses the [https://www.commonwl.org/v1.2/CommandLineTool.html#SecondaryFileSchema](https://www.commonwl.org/v1.2/CommandLineTool.html#SecondaryFileSchema)) and on a `class: File` real object (not a `type: File` specification): [https://www.commonwl.org/v1.2/CommandLineTool.html#File](https://www.commonwl.org/v1.2/CommandLineTool.html#File).

For a `class: File`, the `secondaryFiles` field is an list of `class: File` and/or `class: Directory` objects themselves.

```yaml
steps:
  - id: S_vep
    in:
      - id: gdb
        default:
          class: File
          location: file:///mnt/gdb.vcf.gz
          secondaryFiles:
            - class: File
              location: file:///mnt/gdb.vcf.tbi

```

(For portability reasons, it would be nicer to use a relative path instead of `location`,  
`path: ./gdb.vcf` or `path: ../gdb.vcf` perhaps)
