Skip to content

Commit c41677b

Browse files
authored
Bring workflow outputs out of preview (#6487)
--------- Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent 30f3c3c commit c41677b

File tree

9 files changed

+37
-38
lines changed

9 files changed

+37
-38
lines changed

docs/migrations/25-10.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,35 @@ This syntax allows you to declare all parameters in one place with explicit type
3333

3434
See {ref}`workflow-params-def` for details.
3535

36+
(workflow-outputs-final)=
37+
38+
<h3>Workflow outputs (out of preview)</h3>
39+
40+
{ref}`Workflow outputs <workflow-output-def>`, introduced in Nextflow 24.04 as a preview feature, have been brought out of preview and can now be used without the `nextflow.preview.output` feature flag.
41+
42+
The final version adds the ability to specify a type annotation for each output declaration:
43+
44+
```nextflow
45+
workflow {
46+
main:
47+
ch_samples = // ...
48+
49+
publish:
50+
samples = ch_samples
51+
}
52+
53+
output {
54+
samples: Channel<Map> {
55+
path '.'
56+
index {
57+
path 'samples.csv'
58+
}
59+
}
60+
}
61+
```
62+
63+
See {ref}`migrating-workflow-outputs` to get started.
64+
3665
<h3>Type annotations</h3>
3766

3867
Type annotations are a way to denote the *type* of a variable. They help document and validate pipeline code.

docs/reference/feature-flags.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ Feature flags are used to introduce experimental or other opt-in features. They
4646
`nextflow.preview.output`
4747
: :::{versionadded} 24.04.0
4848
:::
49-
: *Experimental: may change in a future release.*
50-
: When `true`, enables the use of the {ref}`workflow output definition <workflow-output-def>`.
49+
: :::{deprecated} 25.10.0
50+
This feature flag is no longer required to use workflow outputs.
51+
:::
52+
: When `true`, enables the use of {ref}`workflow outputs <workflow-output-def>`.
5153

5254
`nextflow.preview.recursion`
5355
: *Experimental: may change in a future release.*

docs/workflow.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -474,19 +474,8 @@ Workflows can also be invoked recursively:
474474

475475
## Workflow outputs
476476

477-
:::{versionadded} 24.04.0
478-
:::
479-
480-
:::{versionchanged} 24.10.0
481-
A second preview version was introduced. See the {ref}`migration notes <workflow-outputs-second-preview>` for details.
482-
:::
483-
484-
:::{versionchanged} 25.04.0
485-
A third preview version was introduced. See the {ref}`migration notes <workflow-outputs-third-preview>` for details.
486-
:::
487-
488-
:::{note}
489-
This feature requires the `nextflow.preview.output` feature flag to be enabled.
477+
:::{versionadded} 25.10.0
478+
This feature is available as a preview in Nextflow {ref}`24.04 <workflow-outputs-first-preview>`, {ref}`24.10 <workflow-outputs-second-preview>`, and {ref}`25.04 <workflow-outputs-third-preview>`.
490479
:::
491480

492481
A script can define an *output block* which declares the top-level outputs of the workflow. Each output should be assigned in the `publish` section of the entry workflow. Any channel in the workflow can be assigned to an output, including process and subworkflow outputs. This approach is intended to replace the {ref}`publishDir <process-publishdir>` directive.
@@ -505,10 +494,10 @@ process fetch {
505494
506495
workflow {
507496
main:
508-
fetch(params.input)
497+
ch_samples = fetch(params.input)
509498
510499
publish:
511-
samples = fetch.out
500+
samples = ch_samples
512501
}
513502
514503
output {

modules/nextflow/src/main/groovy/nextflow/NF.groovy

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ class NF {
7676
NextflowMeta.instance.isModuleBinariesEnabled()
7777
}
7878

79-
static boolean isOutputDefinitionEnabled() {
80-
NextflowMeta.instance.preview.output
81-
}
82-
8379
static boolean isRecurseEnabled() {
8480
NextflowMeta.instance.preview.recursion
8581
}

modules/nextflow/src/main/groovy/nextflow/NextflowMeta.groovy

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class NextflowMeta {
4242
static class Preview implements Flags {
4343
@Deprecated volatile float dsl
4444
@Deprecated boolean strict
45-
boolean output
4645
boolean recursion
4746
boolean moduleBinaries
4847
boolean types
@@ -58,12 +57,6 @@ class NextflowMeta {
5857
dsl = num
5958
}
6059

61-
void setOutput(Boolean output) {
62-
if( output )
63-
log.warn "WORKFLOW OUTPUT DEFINITION IS A PREVIEW FEATURE - SYNTAX AND FUNCTIONALITY CAN CHANGE IN FUTURE RELEASES"
64-
this.output = output
65-
}
66-
6760
void setRecursion(Boolean recursion) {
6861
if( recursion )
6962
log.warn "NEXTFLOW RECURSION IS A PREVIEW FEATURE - SYNTAX AND FUNCTIONALITY CAN CHANGE IN FUTURE RELEASES"

modules/nextflow/src/main/groovy/nextflow/script/BaseScript.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,6 @@ abstract class BaseScript extends Script implements ExecutionContext {
185185
* @param closure
186186
*/
187187
protected void output(Closure closure) {
188-
if( !NF.outputDefinitionEnabled )
189-
throw new IllegalStateException("Workflow output definition requires the `nextflow.preview.output` feature flag")
190188
if( !entryFlow )
191189
throw new IllegalStateException("Workflow output definition must be defined after the entry workflow")
192190
if( ExecutionStack.withinWorkflow() )

modules/nf-lang/src/main/java/nextflow/script/dsl/FeatureFlagDsl.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ Defines the DSL version (`1` or `2`).
4343
""")
4444
public boolean strict;
4545

46-
@FeatureFlag("nextflow.preview.output")
47-
@Description("""
48-
When `true`, enables the use of the [workflow output definition](https://nextflow.io/docs/latest/workflow.html#workflow-output-def).
49-
""")
50-
public boolean previewOutput;
51-
5246
@FeatureFlag("nextflow.preview.recursion")
5347
@Description("""
5448
When `true`, enables the use of [process and workflow recursion](https://nextflow.io/docs/latest/workflow.html#process-and-workflow-recursion).

tests-v1/output-dsl.nf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
nextflow.preview.output = true
1817

1918
params.save_bam_bai = false
2019

tests/output-dsl.nf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
nextflow.preview.output = true
1817
nextflow.preview.types = true
1918

2019
params.save_bam_bai = false

0 commit comments

Comments
 (0)