×

nf-agent @ 0.3.0

Provider: nextflow-io
Claimed: 20 Aug 2026 12:28:34 (UTC)
Description: This Nextflow plugin provides the `langchain4j` agent runner, enabling lightweight LLM-powered task execution within Nextflow pipelines by integrating with OpenAI-compatible endpoints. It solves the problem of orchestrating AI agents as first-class workflow primitives, allowing language models to call Nextflow modules as tools while benefiting from standard Nextflow features like retries and lineage. Bioinformaticians and workflow developers would use it to incorporate LLM-based decision-making and analysis into data processing pipelines.
Latest version: 0.3.0
Total downloads: 24 View trends

Summary

This plugin provides the langchain4j agent runner, one of the two runners that execute the Nextflow agent primitive.

An agent is a process-shaped primitive: it declares typed inputs and outputs, renders a prompt, calls a language model — optionally letting the model call Nextflow modules as tools — and emits the result on a channel. Each invocation runs as an ordinary Nextflow task, so work directories, retries, parallelism, resume, and lineage all apply.

The langchain4j runner calls the model from the driver JVM, which makes it the lighter of the two runners: no container is pulled and no runtime is shipped. It speaks the OpenAI wire protocol, so any OpenAI-compatible endpoint can be reached by keeping the openai/ model prefix and pointing agent.baseUrl at it. Agents that need a shell tool or container isolation should use the pi runner (nf-agent-pi) instead.

Agents are a preview feature. Their syntax and behavior may change in future releases.

Get Started

Select the runner in your nextflow.config:

agent.runner = 'langchain4j'

The plugin is loaded automatically when the configuration declares an agent scope. Declare it explicitly to pin a version:

plugins {
    id 'nf-agent@0.1.0'
}

Provide the model credential, either through the environment:

export OPENAI_API_KEY="sk-..."

or through configuration, preferably via a pipeline secret:

agent {
    runner = 'langchain4j'
    apiKey = secrets.LLM_KEY
}

Examples

A single agent

agent qa {
    model 'openai/gpt-5-mini'
    instruction 'You are a concise scientific assistant.'

    input:
    question: String

    output:
    stdout()

    prompt:
    """
    Answer briefly: ${question}
    """
}

workflow {
    qa('What is FASTQ format?').view()
}

Structured output

Declare a record type as the output. It is passed to the model as a JSON schema, and the response is validated against it:

record Classification {
    topic: String
    confidence: Float
}

agent classify {
    model 'openai/gpt-5-mini'

    input:
    text: String

    output:
    result: Classification

    prompt:
    """
    Classify the topic of this abstract: ${text}
    """
}

An OpenAI-compatible endpoint

The openai/ prefix names the wire protocol, not the vendor, so a compatible gateway is reached by setting baseUrl:

agent {
    runner = 'langchain4j'
    baseUrl = 'https://openrouter.ai/api/v1'
    apiKey = secrets.OPENROUTER_KEY
    model = 'openai/gpt-5-mini'
}

Filesystem tools

The model can be given tools, including the built-in filesystem family. On this runner the tools execute in the driver JVM, restricted to the agent's work directory, its staged Path inputs, and the module-output paths returned by module tools; only the work directory is writable:

agent reviewer {
    model 'openai/gpt-5-mini'
    tools 'fs:read', 'fs:grep'

    input:
    report: Path

    output:
    stdout()

    prompt:
    """
    Read ${report} and summarize its findings.
    """
}

License

Apache License 2.0

Nextflow version >=26.11.0-edge
Depends On -
Release Date 17 Nov 2026 17:18:00 (UTC)
Release Notes -
Download URL https://registry.nextflow.io/api/v1/plugins/nf-agent/0.3.0/download/nf-agent-0.3.0.zip
Store URL https://public.cr.seqera.io/v2/nextflow/plugin/nf-agent/blobs/sha256:3e6c2f583a3e337b56c725663ce0b31f9221a660d9a11e28b79b456eeef4ed7a
Size 7.7 MB
Checksum 8ca343eed65425540c207ac47abe7dcdf4307b7e0e3dceae8ca169d3af35de4812d39b6d95eda8a93e76ba7f6d10267aa48cde4d75632fdadc2cd071496daae9
Total downloads 0 View trends
Security Scan
Version Nextflow version Date Status Downloads
0.3.0 >=26.11.0-edge 17 Nov 2026 17:18:00 (UTC) 0
0.2.0 >=26.10.0 12 Oct 2026 10:51:16 (UTC) 16
0.1.2 >=26.08.0-edge 06 Oct 2026 10:06:18 (UTC) 1
0.1.1 >=26.08.0-edge 22 Sep 2026 18:45:04 (UTC) 0
0.1.0 >=26.08.0-edge 20 Aug 2026 12:53:17 (UTC) 7