The magic behind the project bin folder is that Nextflow will add it to $PATH, so that when you run a program that is there, the operating system will know where the program is. When you run Rscript, Rscript would be this program, not the argument (R script filename). What you’re doing is almost right! You have the shebang already (#!/usr/bin/env Rscript) so you just have to call your script in the Nextflow pipeline.