I am working through the hello-nextflow material and I have reached the config file tutorial. In this tutorial, an approach to have variable output directory names is shown using ${process}.name. A core part of the workflow, as demonstrated early on in the tutorials is chaining together processes using ${process}.out or ${process}.out.specificNamedOutput. I am new to groovy programming, but the instructor in the video referred to these as attributes. Is there documentation listing the attributes that processes can have?
The only “attribute” that has been allowed historically is .out. However, this pattern is now discouraged as it is not supported with static typing.
You don’t really need it anyway because you can just assign the output of a process to a variable like in any other programming language.
There are no other such attributes. If the training is using something else like .name then that is likely an issue with the training. It may happen to work as a leaky abstraction from the runtime, but it is not really part of the Nextflow language so it should not be relied on.
Interesting that the out attribute is discouraged - the tutorial uses it very consistently, and it is explicitly provided as a way to use the output in Part 3: Hello Workflow - training.nextflow.io
Conveniently, Nextflow automatically packages the output of a process into a channel, as shown in the diagram in the warmup section. We can refer to the output channel of a process as
<process>.out.
Does this mean when chaining processes in a workflow I don’t need to include the .out? Later we use dot notation to access specific outputs from a process with two defined outputs. e.g. <process>.out.report vs <process>.out.results. Is there a way to reference these separate outputs without including .out? e.g. would <process>.results and <process>.report work in the same way?
I do not understand how to publish results without using the .out notation. I have attemted
workflow {
main:
// emit a greeting
sayHello(params.greeting)
publish:
greeting_doc = sayHello[0]
}
which returns the error “Index file record must be a list, map, or file: ProcessDef[process sayHello] [ProcessDef]” and
workflow {
main:
// emit a greeting
sayHello(params.greeting)
publish:
greeting_doc = sayHello
}
which returns the error “Missing process or function getAt([0])”
Hi @Chris_Shave , I just had a quick conversation with @bentsherman to clarify this.
To be clear, the .out notation is still perfectly valid for now. Ben lives in the future ![]()
Looking toward that future though, what he meant is that going forward we’ll switch to doing this (which is already valid and used in many pipelines):
workflow {
main:
greeting_ch = sayHello(params.greeting)
publish:
greeting_doc = greeting_ch
}
It’s a bit more verbose, and may feel like a bit much for a simple case like we have here, but once you start dealing with more complex workflows, the more explicit assignment becomes very helpful. Currently, you would learn about this syntax a bit later in the training materials.
We plan to update the training docs to phase out .out and use this more explicit style everywhere in the next round of major updates (most likely to be released in early 2027).
I see. But what would the syntax be where there are multiple outputs from one process? e.g. <process>.out.report vs <process>.out.outfile, as is demonstrated in Part 3: Hello Workflow - training.nextflow.io
Then the syntax would be eg:
workflow {
main:
output_ch = myProcess(params.input)
publish:
my_report = output_ch.report
my_outfile = output_ch.outfile
}
You’re really just replacing myProcess.out with output_ch and the rest stays the same.