Skip to main content

Inputs and outputs (typed)

Added in version 25.10
note

Typed processes require the nextflow.enable.types feature flag to be enabled in every script that uses them.

Stage directives​

The following directives can be used in the stage: section of a typed process:

env( name: String, String value )​

Declares an environment variable with the specified name and value in the task environment.

stageAs( value: Path, filePattern: String )​

Stages a file into the task directory under the given alias.

stageAs( value: Iterable<Path>, filePattern: String )​

Stages a collection of files into the task directory under the given alias.

stdin( value: String )​

Stages the given value as the standard input (stdin) to the task script.

Outputs​

The following functions are available in the output: and topic: sections of a typed process:

env( name: String ) -> String​

Returns the value of an environment variable from the task environment.

eval( command: String ) -> String​

Returns the standard output of the specified command, which is executed in the task environment after the task script completes.

file( pattern: String, [options] ) -> Path​

Returns a file from the task environment that matches the specified pattern.

Available options:

When true, target files are returned in place of any matching symlink (default: true).

glob: Boolean​

When true, the file name is interpreted as a glob pattern (default: true).

hidden: Boolean​

When true, hidden files are included in the matching output files (default: false).

includeInputs: Boolean​

When true and the file name is a glob pattern, any input files matching the pattern are also included in the output (default: false).

maxDepth: Integer​

Maximum number of directory levels to visit (default: no limit).

optional: Boolean​

When true, the task does not fail if the given file is missing (default: false).

type: String​

Type of paths returned, either file, dir, or any (default: any, or file if the given file name contains a double star (**)).

files( pattern: String, [options] ) -> Set<Path>​

Returns files from the task environment that match the given pattern.

Supports the same options as file() (except for optional).

stdout() -> String​

Returns the standard output of the task script.