×

nf-agent @ 0.1.1

Provider: nextflow-io
Claimed: 20 Aug 2026 12:28:34 (UTC)
Description: This Nextflow plugin provides the `langchain4j` agent runner, which integrates LLMs (supporting OpenAI and compatible endpoints) into Nextflow workflows as lightweight, process-like primitives that can call language models and invoke Nextflow modules as tools. It solves the problem of orchestrating AI-driven steps within data pipelines by enabling typed, reproducible agent tasks that work seamlessly with Nextflow's existing features like retries and lineage. Data scientists and bioinformaticians building AI-augmented workflows would use this plugin to add intelligent decision-making and LLM-based processing steps to their pipelines.
Latest version: 0.1.1
Total downloads: 6 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:
    answer: String

    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:
    summary: String

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

License

Apache License 2.0

Nextflow version >=26.08.0-edge
Depends On -
Release Date 22 Sep 2026 18:45:04 (UTC)
Release Notes -
Download URL https://registry.nextflow.io/api/v1/plugins/nf-agent/0.1.1/download/nf-agent-0.1.1.zip
Store URL https://public.cr.seqera.io/v2/nextflow/plugin/nf-agent/blobs/sha256:bdc5a62af0519e6518439a9755f87d6f648c031f0e4c1c45bb0d4a4a455e9c0d
Size 7.7 MB
Checksum ed42e968e1c2d0884f43a2af9475f06f7daaa3d019f00d6132d1faec0b444d95df1bad71357d42c42c0963d96a1f762528459ab830e3cff7803a359081606637
Total downloads 0 View trends
Security Scan
Version Nextflow version Date Status Downloads
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) 6