Namespaces
This page lists all of the available namespaces in the Nextflow standard library.
Global namespace
The global namespace contains globally available constants and functions.
Constants
baseDir: PathDeprecated since version 20.04.0.
Alias of
workflow.projectDir.launchDir: PathAlias of
workflow.launchDir.moduleDir: PathDirectory where a module script is located (equivalent to
projectDirif used in the main script).paramsMap of workflow parameters specified in the config file or as command line options.
projectDir: PathAlias of
workflow.projectDir.secrets: Map<String,String>New in version 24.02.0-edge.
Map of pipeline secrets. See Secrets for more information.
workDir: PathAlias of
workflow.workDir.
Functions
branchCriteria( criteria: Closure ) -> ClosureCreate a branch criteria to use with the branch operator.
env( name: String ) -> StringNew in version 24.11.0-edge.
Get the value of the environment variable with the specified name in the Nextflow launch environment.
error( message: String = null )Throw a script runtime error with an optional error message.
exit( exitCode: int = 0, message: String = null )Deprecated since version 22.06.0-edge: Use
error()insteadStop the pipeline execution and return an exit code and optional error message.
file( filePattern: String, [options] ) -> Path | List<Path>Get a file from a file name or glob pattern. Returns a collection of files if the glob pattern yields zero or multiple files.
The following options are available:
checkIfExists: booleanWhen
true, throws an exception if the specified path does not exist in the file system (default:false)followLinks: booleanWhen
true, follows symbolic links when traversing a directory tree, otherwise treats them as files (default:true)glob: booleanWhen
true, interprets characters*,?,[]and{}as glob wildcards, otherwise handles them as normal characters (default:true)hidden: booleanWhen
true, includes hidden files in the resulting paths (default:false)maxDepth: intMaximum number of directory levels to visit (default: no limit)
type: StringType of paths returned, can be
'file','dir'or'any'(default:'file')
See also: channel.fromPath.
files( filePattern: String, [options] ) -> List<Path>Get a collection of files from a file name or glob pattern. Supports the same options as
file().groupKey( key, size: int ) -> GroupKeyCreate a grouping key to use with the groupTuple operator.
multiMapCriteria( criteria: Closure ) -> ClosureCreate a multi-map criteria to use with the multiMap operator.
print( value )Print a value to standard output.
printf( format: String, values... )Print a formatted string with the given values to standard output.
println( value )Print a value to standard output with a newline.
sendMail( [options] )Send an email. See Notifications for more information.
sleep( milliseconds: long )Sleep for the given number of milliseconds.
tuple( args... ) -> TupleCreate a tuple object from the given arguments.
channel
The channel namespace contains the built-in channel factories. See Channel factories for details.
log
The log namepsace contains functions for logging messages to the console.
error( message: String )Log an error message to the console.
This function does not terminate the pipeline – use the global
error()function instead.info( message: String )Log an info message to the console.
warn( message: String )Log a warning message to the console.
nextflow
The nextflow namespace contains information about the current Nextflow runtime.
build: intNextflow runtime build number.
timestamp: StringNextflow runtime compile timestamp.
version: VersionNumberNextflow runtime version number. See VersionNumber for more information.
workflow
The workflow namespace contains information about the current workflow run.
Properties
commandLine: StringCommand line as entered by the user to launch the workflow execution.
commitId: StringGit commit ID of the executed workflow repository.
When providing a Git tag, branch name, or commit hash using the
-rCLI option, the associatedworkflow.commitIdis also populated.complete: OffsetDateTimeAvailable only in the
workflow.onCompletehandlerTimestamp of workflow when execution is completed.
configFiles: List<Path>Configuration files used for the workflow execution.
container: String | Map<String,String>Docker image used to run workflow tasks, or a map of process names to process containers when multiple images are used.
containerEngine: StringReturns the name of the container engine (e.g. docker or singularity) or null if no container engine is enabled.
duration: DurationAvailable only in the
workflow.onCompletehandlerTime elapsed to complete workflow execution.
errorMessage: StringAvailable only in the
workflow.onCompleteandworkflow.onErrorhandlersError message of the task that caused the workflow execution to fail.
errorReport: StringAvailable only in the
workflow.onCompleteandworkflow.onErrorhandlersDetailed error of the task that caused the workflow execution to fail.
exitStatus: intAvailable only in the
workflow.onCompleteandworkflow.onErrorhandlersExit status of the task that caused the workflow execution to fail.
failOnIgnore: booleanNew in version 24.05.0-edge.
Whether the
workflow.failOnIgnoreconfig option was enabled.See also: errorStrategy
fusionNamespace containing information about the current Fusion runtime. The following properties are available:
enabled: booleanWhether Fusion is enabled.
version: StringThe Fusion version being used.
homeDir: PathUser system home directory.
launchDir: PathDirectory where the workflow was launched.
manifestNamespace corresponding to the manifest config scope.
outputDir: PathNew in version 24.10.0.
Workflow output directory.
preview: booleanNew in version 24.04.0.
Whether the current workflow run is a preview run.
profile: StringComma-separated list of active configuration profiles.
projectDir: PathDirectory where the workflow project is located.
repository: StringProject repository Git remote URL.
resume: booleanReturns
truewhenever the current instance is resumed from a previous execution.revision: StringGit branch/tag of the executed workflow repository.
When providing a Git tag or branch name using the
-rCLI option, theworkflow.revisionis also populated.runName: StringMnemonic name assigned to this execution instance.
scriptFile: PathProject main script file path.
scriptId: StringProject main script unique hash ID.
scriptName: StringProject main script file name.
sessionId: UUIDUnique identifier (UUID) associated to current execution.
start: OffsetDateTimeTimestamp of workflow at execution start.
stubRun: booleanReturns
truewhenever the current instance is a stub-run execution .success: booleanAvailable only in the
workflow.onCompleteandworkflow.onErrorhandlersReports if the execution completed successfully.
userName: StringUser system account name.
waveNamespace containing Wave runtime information. The following properties are available:
enabled: booleanWhether Wave is enabled.
workDir: PathThe directory where task temporary files are stored.
Functions
onComplete( action: Closure )Define an action to take when the workflow completes (whether successful or not).
onError( action: Closure )Define an action to take if the workflow is terminated due to a runtime error or task failure.