Skip to main content

flyteplugins-nextflow

Run Nextflow pipelines on Flyte.

The Nextflow head runs inside a Flyte task. The nf-flyte Nextflow plugin runs every Nextflow task as a child action of that task. A pipeline therefore shows up in Flyte as one run with one action per Nextflow task:

  • Each process runs in its own container, with its cpus, memory, disk, accelerator and time directives. The image only needs bash: Flyte stages the task's files.
  • Nextflow keeps its own retries (errorStrategy) and -resume; Flyte caches task results across runs.
  • Aborting the Flyte run aborts the pipeline and its running tasks.

Installation

pip install flyteplugins-nextflow

Quick start

import flyte
from flyte.io import Dir
from flyteplugins.nextflow import nextflow_image, run_nextflow

env = flyte.TaskEnvironment(name="nextflow", image=nextflow_image())


@env.task
async def demo() -> Dir:
    return await run_nextflow("nf-core/demo", revision="1.2.0", profile="test", outdir="results")

run_nextflow accepts:

Argument Description
pipeline Repository (nf-core/rnaseq), URL or path to run.
revision Git tag, branch or commit (-r).
profile Config profiles (-profile).
params Pipeline parameters, passed as a params file.
outdir --outdir. A relative path goes under the task's raw data prefix. The directory is returned as a Dir.
work_dir Work directory. Default: nextflow-work under the task's raw data prefix.
config Extra Nextflow config, as a file path or config text.
resume Resume the previous run that used the same work_dir.
report Render Nextflow's execution report, timeline and DAG into the task's Flyte report. The task must be declared with report=True.
extra_args Any other nextflow run arguments.

If Nextflow fails, run_nextflow raises a NextflowError containing the end of the Nextflow output and the end of .nextflow.log.

Resume

Nextflow's resume state lives in the work directory, not in the task pod:

  • the task cache (the cloud cache on object stores, .nextflow locally)
  • a session ID derived from the work directory

This has two effects:

  • Retries resume automatically. The default work directory is shared by all attempts of a task, so a retried task passes -resume and picks up where the failed attempt stopped.

  • Resuming across runs needs a fixed work_dir. Pass the same work_dir to each run, and resume=True from the second run on:

    await run_nextflow("nf-core/rnaseq", work_dir="s3://my-bucket/rnaseq-work", resume=True)
    

Local runs

When the task runs locally (flyte run --local), Nextflow uses its own executors instead of nf-flyte: local by default, or whatever profile or config selects, such as docker. This needs nextflow on the PATH.

Image

nextflow_image() builds the image for the task that runs the Nextflow head. It contains a JRE, Nextflow (nextflow_version, default 25.10.6), the nf-flyte plugin and flyteplugins-nextflow itself. To use a locally built plugin, pass its zip:

from pathlib import Path

image = nextflow_image(nf_flyte=Path("~/nf-flyte/build/distributions/nf-flyte-0.2.1.zip").expanduser())

Requirements

  • Flyte v2. On a cluster, the work directory must be on an object store Flyte can read (S3, GCS or Azure); the default, under the task's raw data prefix, always is.
  • Every process container needs bash.

Metadata

Release files for flyteplugins-nextflow 2.12.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for flyteplugins-nextflow 2.12.4
File Interpreter ABI Platform Actions
flyteplugins_nextflow-2.12.4-py3-none-any.whl Python 3 none any Details for flyteplugins_nextflow-2.12.4-py3-none-any.whl

Release files / flyteplugins_nextflow-2.12.4-py3-none-any.whl

Download URL flyteplugins_nextflow-2.12.4-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bdc61a859f4546d2953ed2033fdaafe732be92632493cf3358e665baf93f3196
BLAKE2b-256 checksum
How to use checksums
dc90d1825c23f2a7a449e252146761d2f2921b2c90e7663d273b605878e342bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.17

Security for flyteplugins-nextflow 2.12.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page