×

nf-agent @ 0.2.0

Provider: nextflow-io
Claimed: 20 Aug 2026 12:28:34 (UTC)
Description: This Nextflow plugin provides the `langchain4j` agent runner, enabling language model integration directly within Nextflow workflows by calling OpenAI-compatible endpoints from the driver JVM. It solves the problem of incorporating AI-powered decision-making and tool execution into data pipelines with minimal overhead, making it ideal for bioinformaticians and pipeline developers who need to combine LLM reasoning with Nextflow's task management capabilities.
Latest version: 0.2.0
Total downloads: 14 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.10.0
Depends On -
Release Date 12 Oct 2026 10:51:16 (UTC)
Release Notes -
Download URL https://registry.nextflow.io/api/v1/plugins/nf-agent/0.2.0/download/nf-agent-0.2.0.zip
Store URL https://public.cr.seqera.io/v2/nextflow/plugin/nf-agent/blobs/sha256:5c75d00502912f1d33a34fd84d7b5bb66eb438fb3c55d706fdfc2a35637144ad
Size 7.7 MB
Checksum f6961b8b25bc57966094b3bbc41ddd315df9553ac7317682e72c74e17e305b5363fdc5efaa2aa3899421f1c54df0e7de04cd134c3edae094249fd59e45bef9cd
Total downloads 6 View trends
Security Scan
Version Nextflow version Date Status Downloads
0.2.0 >=26.10.0 12 Oct 2026 10:51:16 (UTC) 6
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