# Static typing disables named workflow outputs in Nextflow

**URL:** <https://community.seqera.io/t/static-typing-disables-named-workflow-outputs-in-nextflow/2657>\
**Category:** Ask for help\
**Tags:** nextflow\
**Created:** [May 9, 2026, 3:39pm UTC](https://community.seqera.io/t/static-typing-disables-named-workflow-outputs-in-nextflow/2657 "2026-05-09T15:39:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![valterschutz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/valterschutz/32/2423_2.png) [@valterschutz](https://community.seqera.io/u/valterschutz)\
**Post date:** [May 9, 2026, 3:39pm UTC](https://community.seqera.io/t/static-typing-disables-named-workflow-outputs-in-nextflow/2657/1 "2026-05-09T15:39:33Z")

</div>

According to [Workflows (typed) | Seqera Docs](https://docs.seqera.io/nextflow/workflow-typed#typed-workflows), it should be possible to assign named outputs to subworkflows, using the syntax `result: Value<Path> = val_bye`. I then expected to be able to access the named outputs using dot-notation. However, the following example fails to execute:

```groovy
nextflow.enable.types = true

workflow myWorkflowValue {
  main:

  val = channel.value(5)

  emit:
  my_data: Value<Integer> = val
}

workflow myWorkflowChannel {
  main:

  ch = channel.fromList([1,2])

  emit:
  my_data: Channel<Integer> = ch
}

workflow {
  main:

  result = myWorkflowValue()
  // result = myWorkflowChannel()
  s = result.my_data
}

```

producing the error

```shell
❯ nextflow run main.nf

 N E X T F L O W ~ version 26.04.0

Launching `main.nf` [romantic_angela] revision: 329e302a9a

WARN: Static typing is a preview feature -- syntax and behavior may change in future releases
ERROR ~ No such variable: my_data

 -- Check script 'main.nf' at line: 26 or see '.nextflow.log' file for more details

```

The error occurs with both the channel version and the value version.

It seems that by enabling static typing, we also disable named outputs, but I cannot find any documentation about this.

Another example to illustrate this. [Workflows | Seqera Docs](https://docs.seqera.io/nextflow/workflow#takes-and-emits) (essentially) has the following example, which executes correctly

```groovy
workflow my_workflow {
    main:
    ch_bye = channel.fromList([1,2])

    emit:
    my_data = ch_bye
}

workflow {
    result = my_workflow()
    result.my_data.view()
}

```

However, if I add `nextflow.enable.types = true`, then I once again get the same error:

```shell
❯ nextflow run main.nf

 N E X T F L O W ~ version 26.04.0

Launching `main.nf` [maniac_noyce] revision: b6cc489e8a

WARN: Static typing is a preview feature -- syntax and behavior may change in future releases
ERROR ~ No such variable: my_data

 -- Check script 'main.nf' at line: 16 or see '.nextflow.log' file for more details

```

---

<div class="post-metadata">

**Author:** ![valterschutz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/valterschutz/32/2423_2.png) [@valterschutz](https://community.seqera.io/u/valterschutz)\
**Post date:** [May 9, 2026, 4:22pm UTC](https://community.seqera.io/t/static-typing-disables-named-workflow-outputs-in-nextflow/2657/2 "2026-05-09T16:22:29Z")

</div>

Actually, by following [Migrating to static typing | Seqera Docs](https://docs.seqera.io/nextflow/tutorials/static-types) I was able to get it to work by simply using the subworkflow output directly, without using dot-notation:

```groovy
nextflow.enable.types = true

workflow myWorkflowValue {
  main:

  val = channel.value(5)

  emit:
  my_data: Value<Integer> = val
}

workflow {
  main:

  output = myWorkflowValue()
  output.view()
}

```

However, this usage seems weird to me, since the `my_data` name is totally redundant.

More importantly, I also got it to work by **just adding another output**

```groovy
nextflow.enable.types = true

workflow myWorkflowValue {
  main:

  val1 = channel.value(5)
  val2 = channel.value(6)

  emit:
  my_data1: Value<Integer> = val1
  my_data2: Value<Integer> = val2
}

workflow {
  main:

  output = myWorkflowValue()
  output.my_data1.view()
}

```

Commenting out the second output of `myWorkflowValue` breaks the entry workflow. I think this is a bug?

---

<div class="post-metadata">

**Author:** ![bentsherman](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/bentsherman/32/52_2.png) [@bentsherman](https://community.seqera.io/u/bentsherman)\
**Post date:** [May 9, 2026, 7:57pm UTC](https://community.seqera.io/t/static-typing-disables-named-workflow-outputs-in-nextflow/2657/3 "2026-05-09T19:57:06Z")

</div>

I think this behavior is a rough edge that results from allowing typed workflows to be used interchangeably with legacy workflows. To make a long story short, a single named output is a degenerate case since you don’t really need the name, so the simplest solution was to not support this case with static typing.

So the main two patterns are (1) a single output expression or (2) multiple named outputs. Which matches what you found. But I guess this rough edge should be documented somewhere

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/system/32/2402_2.png) [@system](https://community.seqera.io/u/system)\
**Post date:** [May 16, 2026, 7:57pm UTC](https://community.seqera.io/t/static-typing-disables-named-workflow-outputs-in-nextflow/2657/4 "2026-05-16T19:57:21Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
