nf-flyte @ 0.2.1
Summary
nf-flyte runs Nextflow pipelines on Flyte v2. It adds a flyte executor that runs each Nextflow task as a Flyte action. The Nextflow head itself runs as a Flyte task, so the whole pipeline shows up as one Flyte run with one child action per task.
- Each task runs in its own
containerwith no extra tooling: Flyte moves the task's data. Its input files are FlyteFile/Dirinputs, and its work dir comes back as aDiroutput, staged by Flyte's copilot. Task pods never touch the work dir themselves. - Nextflow keeps retries (
errorStrategy) and-resume. Flyte retries are off for task actions. - Flyte caches task results under a key derived from the task's script, container, inputs and
binscripts but not the Nextflow session, so a task done in one run is reused by the next. - A failed task shows as failed in Flyte and is never cached; Nextflow still gets its exit code, stdout and stderr.
- Killing a task or cancelling the pipeline aborts the matching Flyte actions.
- Nothing polls Flyte. Task actions are enqueued through the Actions service, and their state comes from its
WatchForUpdatesstream, which the head keeps open for the whole pipeline.
Get Started
Run Nextflow from inside a Flyte v2 task. The Flyte runtime provides the endpoint, org/project/domain, run location and API key through the task's environment. The task also needs to set NF_FLYTE_RUN_NAME (and NF_FLYTE_PARENT_ACTION when it isn't a0).
plugins {
id 'nf-flyte@0.1.0'
}
process.executor = 'flyte'
workDir = 's3://<bucket>/<path>'
Work directory: any object store that both the Nextflow head and Flyte can read, e.g. the task's own Flyte storage (the default with flyteplugins-nextflow). S3, GCS and Azure all work, through Nextflow's nf-amazon, nf-google and nf-azure plugins.
Task containers need bash, nothing else.
Launching outside Flyte
You can also run nextflow run on a laptop or in CI. The executor then creates the Flyte run itself and prints its URL. Its root action stands for the Nextflow head:
- Its task is named after the pipeline: the manifest name (e.g.
nf-core/rnaseq), else the project it was pulled from, else the main script. - It ends with the pipeline's result. Stopping Nextflow (Ctrl+C, SIGTERM) aborts the run, which then shows as aborted rather than failed.
- It fails if the head stops sending heartbeats (for example, a closed laptop or a killed CI job), which also aborts the run's remaining tasks.
flyte {
endpoint = 'tenant.hosted.unionai.cloud' // default: from the API key
org = 'my-org' // default: from the API key
project = 'my-project'
domain = 'development'
// either `export FLYTE_API_KEY=...`, or a command that prints an access token:
// authCommand = 'my-cli print-token'
heartbeatTimeout = '5m' // default: 5m
}
workDir = 's3://<bucket>/<path>' // readable by Flyte, writable from where you run
Examples
flyte {
queue = 'gpu' // Flyte queue for task actions (default: the run's queue)
pollInterval = '10s' // fallback check of running tasks; status itself is pushed (default: 5s)
cache = true // cache task results in Flyte (default: true)
}
All flyte options are optional inside Flyte. Each one defaults to a value from the task's environment:
| Option | Default source |
|---|---|
endpoint |
_U_EP_OVERRIDE |
org |
_U_ORG_NAME |
project |
FLYTE_INTERNAL_EXECUTION_PROJECT |
domain |
FLYTE_INTERNAL_EXECUTION_DOMAIN |
runName |
NF_FLYTE_RUN_NAME |
parentAction |
NF_FLYTE_PARENT_ACTION, else a0 |
runOutputBase |
_U_RUN_BASE |
The API key comes from _UNION_EAGER_API_KEY, EAGER_API_KEY or FLYTE_API_KEY. It is never read from the config file.
Process directives map to the Flyte action like this:
| Nextflow | Flyte |
|---|---|
container |
container image (required) |
cpus, memory, disk |
CPU / MEMORY / EPHEMERAL_STORAGE requests = limits |
accelerator |
GPU |
time |
task timeout |
How a task runs
- The head renders Nextflow's usual task wrapper (
.command.run), with the pod's paths, into the task dir, and writes the action'sinputs.pbunder the Flyte run's storage, where the Flyte UI reads it. If the run's storage isn't writable,inputs.pbgoes in the task dir (.flyte/inputs.pb) instead: the task still runs, but the UI won't show its inputs. - Flyte's copilot downloads every input file into the pod, keeping its name. The wrapper runs the task in a scratch dir, linking the inputs under their Nextflow stage names, and copies the declared outputs and the
.command.*files to the directory copilot uploads. - On success, the head copies that directory into the task dir, where Nextflow collects the outputs. On failure, the pod reports the exit code and the end of stdout/stderr through copilot's error file: Flyte fails the action (without caching it), and the head writes
.exitcode,.command.outand.command.errback for Nextflow'serrorStrategy.
If the pod itself dies (e.g. it's OOM-killed), the task gets the pod's exit code (e.g. 137), so exit-code-based retry rules keep working.
Caching
The Flyte cache key covers what Nextflow's task hash covers except the session: the process, its rendered script, container, environment and bin scripts, and its input files. An input produced by another task is identified by that task's key (saved in its task dir as .flyte/cache_key), so keys chain through the pipeline without reading file contents. Processes with cache false, and all tasks with flyte.cache = false, are never cached.
Plugin development
The Flyte client lives in the controller subproject (Kotlin, connect-kotlin): an informer over ActionsService/WatchForUpdates keeps every task action's state in memory, and the executor reads it from there. It is a standalone library with a documented API for any JVM language: see controller/README.md. Its protobuf and Connect code is generated at build time from the flyteidl2 protos vendored in controller/src/main/proto; refresh them with scripts/update-protos.sh <flyte tag>. Building needs JDK 21.
make assemble # build
make test # unit tests
make install # install into ~/.nextflow/plugins
make release # publish to the Nextflow registry (needs npr.apiKey in ~/.gradle/gradle.properties)
License
| Nextflow version | >=25.10.0 |
|---|---|
| Depends On | - |
| Release Date | 23 Oct 2026 23:33:38 (UTC) |
| Release Notes | - |
| Download URL | https://registry.nextflow.io/api/v1/plugins/nf-flyte/0.2.1/download/nf-flyte-0.2.1.zip |
| Store URL | https://public.cr.seqera.io/v2/nextflow/plugin/nf-flyte/blobs/sha256:79d901195b64b63c4b26b9b4736d288215d485d4ecdea3e7a53879b03512bc7d |
| Size | 13.3 MB |
| Checksum | 73653231fdc62d7bc3cb30e0ac954f60e6f8b1955c4a83102b5ec54e28e1f61c20e555113c118ff1accffc2aae4e9de8cb7bfe094f1df6bb656c7367c62b8af4 |
| Total downloads | 175 View trends |
| Security Scan |