I am experimenting with how processes work. The hello nextflow tutorial demonstrates that inputs can be typed as path or val. I found this documentation page that describes what is acceptable as an input and output: Process reference | Seqera Docs
I was a little surprised that the tutorial seems to describe legacy inputs and outputs, or that I seemingly don’t understand how to read the documentation.
I have attempted to output a value from a process, but it is not working. I do not know what I am doing wrong.
process sayHello {
input:
val greeting
output:
val "${random_variable}"
path 'output.txt'
script:
"""
echo '${greeting}' > output.txt
export random_variable="Cheese"
"""
}
Error hello-world.nf:14:12: `random_variable` is not defined
│ 14 | val "${random_variable}"
╰ | ^^^^^^^^^^^^^^^
I don’t strictly understand what the val output is for, but I had guessed that it was a wau to export variables that might be created within the script.