Skip to content

Commit d4a9dab

Browse files
committed
Add 26.04 migration docs
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent a12bde3 commit d4a9dab

File tree

5 files changed

+428
-110
lines changed

5 files changed

+428
-110
lines changed

docs/migrations/26-04.md

Lines changed: 363 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,363 @@
1+
(migrating-26-04-page)=
2+
3+
# Migrating to 26.04 (preview)
4+
5+
This page summarizes the upcoming changes in Nextflow 26.04, which will be released in April 2026.
6+
7+
:::{note}
8+
This page is a work in progress and will be updated as features are finalized. It should not be considered complete until the 26.04 release.
9+
:::
10+
11+
## New features
12+
13+
<h3>Module system</h3>
14+
15+
Nextflow now has native support for publishing, installing, running, and including remote modules using the [Nextflow registry](https://registry.nextflow.io/).
16+
17+
The new `module` command can be used to work with remote modules:
18+
19+
```bash
20+
# Run a module directly
21+
nextflow module run nf-core/fastqc --meta.id 1 --reads sample1.fastq
22+
23+
# Search for modules in registry
24+
nextflow module search bwa
25+
26+
# Get info about a module
27+
nextflow module info nf-core/bwa/mem
28+
29+
# Install a module
30+
nextflow module install nf-core/bwa/mem
31+
```
32+
33+
Remotes modules are installed into the `modules` directory of your project. They can be included in scripts by name instead of relative path:
34+
35+
```nextflow
36+
// before
37+
include { BWA_MEM } from '../../../modules/nf-core/bwa/mem'
38+
39+
// after
40+
include { BWA_MEM } from 'nf-core/bwa/mem'
41+
```
42+
43+
:::{note}
44+
All [nf-core modules](https://github.com/nf-core/modules) are automatically synced to the registry from GitHub. They are available as `nf-core/<name>` as shown above.
45+
:::
46+
47+
See {ref}`module-registry` and the {ref}`cli-module` command reference for details.
48+
49+
<h3>Record types</h3>
50+
51+
Records are a new data structure for modeling composite data. They serve as an alternative to tuples -- whereas tuple elements must be accessed by index, record fields are accessed by name. This allows you to model data with meaningful names instead of keeping track of how tuple elements are ordered.
52+
53+
A record can be created using the `record()` function:
54+
55+
```nextflow
56+
sample = record(
57+
id: '1',
58+
fastq_1: file('1_1.fastq'),
59+
fastq_2: file('1_2.fastq')
60+
)
61+
62+
println sample.id
63+
println sample.foo // error: unrecognized property `foo`
64+
```
65+
66+
Record types are a way to define custom types for validating records:
67+
68+
```nextflow
69+
record Sample {
70+
id: String
71+
fastq_1: Path
72+
fastq_2: Path?
73+
}
74+
```
75+
76+
While records created with the `record()` function can have any set of fields, record types can be used to specify a minimum set of requirements in a particular context, such as a process, function, or workflow:
77+
78+
```nextflow
79+
def hello(sample: Sample) {
80+
println "Hello sample ${sample.id}!"
81+
}
82+
83+
workflow {
84+
sample1 = record(id: '1', fastq_2: file('1_2.fastq'))
85+
hello(sample1) // error: `sample1` is missing `fastq_1` field required by Sample
86+
87+
sample2 = record(id: '1', fastq_1: file('1_1.fastq'))
88+
hello(sample2) // ok
89+
90+
sample3 = record(id: '1', single_end: true, fastq_1: file('1_1.fastq'))
91+
hello(sample3) // also ok
92+
}
93+
```
94+
95+
See {ref}`script-records` for details. See {ref}`migrating-static-types` for more information about migrating from tuples to records.
96+
97+
<h3>Static typing (preview)</h3>
98+
99+
:::{note}
100+
Typed processes and typed workflows require the `nextflow.preview.types` feature flag to be enabled in every script that uses them.
101+
:::
102+
103+
Nextflow 26.04 brings full support for static typing with {ref}`typed processes <process-typed-page>` and {ref}`typed workflows <workflow-typed-page>`.
104+
105+
Typed processes can now declare record inputs and outputs:
106+
107+
```nextflow
108+
nextflow.preview.types = true
109+
110+
process FASTQC {
111+
input:
112+
record(
113+
id: String,
114+
fastq_1: Path,
115+
fastq_2: Path
116+
)
117+
118+
output:
119+
record(
120+
id: id,
121+
fastqc: file('fastqc_logs')
122+
)
123+
124+
script:
125+
// ...
126+
}
127+
```
128+
129+
Typed workflows can declare typed inputs and outputs, and provide first-class support for static typing in dataflow logic:
130+
131+
```nextflow
132+
nextflow.preview.types = true
133+
134+
workflow RNASEQ {
135+
take:
136+
read_pairs_ch: Channel<Sample>
137+
transcriptome: Path
138+
139+
main:
140+
index = INDEX(transcriptome)
141+
fastqc_ch = FASTQC(read_pairs_ch)
142+
quant_ch = QUANT(read_pairs_ch, index)
143+
samples_ch = fastqc_ch.join(quant_ch, by: 'id')
144+
145+
emit:
146+
samples: Channel<AlignedSample> = samples_ch
147+
}
148+
149+
record Sample { /* ... */ }
150+
record AlignedSample { /* ... */ }
151+
```
152+
153+
Several operators have been extended to support static typing and records:
154+
155+
- `combine` can now combine records or tuples
156+
- `groupBy` can group channel values while being statically typed (replaces `groupTuple`)
157+
- `join` can now join records by matching field
158+
159+
Breaking changes from the {ref}`first preview <static-typing-first-preview>`:
160+
161+
- The syntax for process tuple inputs has been updated:
162+
163+
```nextflow
164+
// 25.10
165+
input:
166+
(id, fastq_1, fastq_2): Tuple<String,Path,Path>
167+
168+
// 26.04
169+
input:
170+
tuple(id: String, fastq_1: Path, fastq_2: Path)
171+
```
172+
173+
- The method signature for the `stageAs` directive was changed from `(filePattern, value)` to `(value, filePattern)`.
174+
175+
- The `nextflow.preview.types` feature flag must be enabled in order to use type annotations in workflow takes/emits.
176+
177+
See {ref}`migrating-static-types` for more information about migrating to static typing. See {ref}`migrating-static-types-operators` for best practices on using operators with static typing.
178+
179+
## Enhancements
180+
181+
<h3>Strict syntax parser enabled by default</h3>
182+
183+
The {ref}`strict syntax parser <strict-syntax-page>` is now enabled by default. This change brings the rich error checking of `nextflow lint` to `nextflow run`, and makes it easier to adopt new language features.
184+
185+
The legacy parser can be re-enabled by setting the `NXF_SYNTAX_PARSER` environment variable to `v1`.
186+
187+
<h3>Agent logging mode</h3>
188+
189+
Nextflow prints logs in an agent-friendly format when enabled via `NXF_AGENT_MODE=1`:
190+
191+
```console
192+
$ NXF_AGENT_MODE=1 nextflow run [...]
193+
[PIPELINE] nf-core/rnaseq 3.14.0 | profile=test,docker
194+
[WORKDIR] /path/to/work
195+
[PROCESS b8/623fc3] sayHello (3)
196+
[PROCESS 5f/761e51] sayHello (2)
197+
198+
[WARN] Task runtime metrics are not reported when using macOS
199+
200+
[ERROR] FASTQC (sample_1)
201+
exit: 127
202+
cmd: fastqc --version
203+
stderr: bash: fastqc: command not found
204+
workdir: /path/to/work/ab/123456
205+
206+
[SUCCESS] completed=10 failed=0 cached=5
207+
```
208+
209+
Agent mode provides minimal structured logging for efficient token usage. It is ideal when using agents to run and debug Nextflow runs.
210+
211+
<h3>Multi-revision checkout for pipelines</h3>
212+
213+
Nextflow now checks out pipelines separately by revision when running remote pipelines, allowing you to run multiple revisions of a pipeline at the same time.
214+
215+
Nextflow uses the default branch specified by the Git repository when no revision is specified, instead of defaulting to the `master` branch. Since each revision is checked out separately, using a specific revision doesn't prevent the use of the default branch on subsequent runs.
216+
217+
Because of this update, the `manifest.defaultBranch` config option is no longer needed.
218+
219+
<h3>Load collection-type params automatically from files</h3>
220+
221+
When using the `params` block, collection-type parameters such as `List<Record>` can be loaded automatically from a CSV, JSON, or YAML file. This feature simplifies the loading of samplesheet inputs and allows a pipeline to support multiple structured data formats.
222+
223+
See {ref}`workflow-typed-params` for details. See {ref}`migrating-static-types` for a migration example.
224+
225+
<h3>Print workflow outputs on run completion</h3>
226+
227+
Nextflow prints a summary of the workflow outputs at the end of a run, when the `output` block is defined.
228+
229+
For example, given the following output block:
230+
231+
```nextflow
232+
workflow {
233+
// ...
234+
}
235+
236+
output {
237+
samples {
238+
path { sample -> "${sample.id}" }
239+
index {
240+
path 'samples.csv'
241+
}
242+
}
243+
244+
multiqc_report {
245+
path 'multiqc_report.html'
246+
}
247+
}
248+
```
249+
250+
Nextflow prints the following summary:
251+
252+
```console
253+
$ nextflow -q run main.nf
254+
Outputs:
255+
256+
/path/to/results
257+
258+
samples: samples.csv
259+
260+
multiqc_report: multiqc_report.html
261+
```
262+
263+
You can specify `-output-format json` to produce JSON output instead:
264+
265+
```console
266+
$ nextflow -q run main.nf -output-format json
267+
{
268+
"samples": "/path/to/results/samples.csv",
269+
"multiqc_report": "/path/to/results/multiqc_report.html"
270+
}
271+
```
272+
273+
The `module run` command prints a summary of the module outputs:
274+
275+
```console
276+
$ nextflow -q module run nf-core/fastqc --meta.id 1 --reads sample1.fastq -output-format json
277+
{
278+
"html": [
279+
{
280+
"id": "SRR6357070_1"
281+
},
282+
"/path/to/results/SRR6357070_1_fastqc.html"
283+
],
284+
"zip": [
285+
{
286+
"id": "SRR6357070_1"
287+
},
288+
"/path/to/results/SRR6357070_1_fastqc.zip"
289+
]
290+
}
291+
```
292+
293+
See the {ref}`cli-run` command reference for details.
294+
295+
<h3>New <code>-project-dir</code> option for <code>lint</code> command</h3>
296+
297+
The `lint` command now has a `-project-dir` option, which can be used to specify the project root when linting files.
298+
299+
For example, given the following project structure:
300+
301+
```
302+
├── lib
303+
│ └── Utils.groovy
304+
├── modules
305+
│ └── nf-core
306+
│ └── fastqc
307+
│ ├── main.nf
308+
│ └── ...
309+
├── workflows
310+
│ └── rnaseq.nf
311+
├── main.nf
312+
└── nextflow.config
313+
```
314+
315+
You can specify `-project-dir` when linting from a location other than the project root:
316+
317+
```bash
318+
cd workflows
319+
nextflow lint -project-dir ../ rnaseq.nf
320+
```
321+
322+
This option allows the linter to resolve remote module includes and Groovy code in the `lib` directory:
323+
324+
```nextflow
325+
// workflows/rnaseq.nf
326+
327+
include { FASTQC } from 'nf-core/fastqc'
328+
329+
workflow RNASEQ {
330+
// ...
331+
332+
Utils.validateInput( /* ... */ )
333+
334+
// ...
335+
}
336+
```
337+
338+
See the {ref}`cli-lint` command reference for details.
339+
340+
## Breaking changes
341+
342+
- The {ref}`strict syntax parser <strict-syntax-page>` is now enabled by default. The legacy parser can be enabled by setting the `NXF_SYNTAX_PARSER` environment variable to `v1`.
343+
344+
## Deprecations
345+
346+
- The `nextflow.enable.strict` feature flag is deprecated. It is not needed when {ref}`strict syntax <strict-syntax-page>` is enabled.
347+
348+
- The `manifest.defaultBranch` config option is deprecated. Nextflow can automatically detect the default branch when using a remote pipeline.
349+
350+
- The Path `listFiles()` method is deprecated. Use `listDirectory()` instead.
351+
352+
- Several operators have been deprecated. See {ref}`operator-page` for details.
353+
354+
## Miscellaneous
355+
356+
- New config option: `aws.batch.forceGlacierTransfer`
357+
- New config option: `executor.onlyJobState`
358+
- New config option: `google.batch.installOpsAgent`
359+
- New config option: `google.batch.logsPath`
360+
- New config option: `wave.build.conda.baseImage`
361+
- New config option: `wave.build.template`
362+
- New standard library function: `listDirectory()`
363+
- Support Java 26

docs/migrations/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This section covers important information for migrating between Nextflow version
77
```{toctree}
88
:maxdepth: 1
99
10+
26-04
1011
25-10
1112
25-04
1213
24-10

0 commit comments

Comments
 (0)