How to access the version information within Nextflow's manifest scope

Viewed 27

Say I have a manifest scope defined like so

manifest {
    version = '1.2.3'
}

If I try to access the version component of that scope in a process, like this:

process TEST {
    script:
        """
        somescript ${manifest.version}
        """
}

Then I get an error saying: No such variable: manifest

Is it possible to access the variables within the manifest scope in Nextflow, and, if so, what is the proper syntax.

1 Answers

Entries in the manifest scope can be accessed using the workflow object. To get the pipeline version number from the manifest (assuming it has been set), use: workflow.manifest.version. Your test process might then look like:

process test {
    
    """
    echo "${workflow.manifest.version}"
    """
}
Related