About addParam and params deprecation

Hello everyone!!

Just a quick question. Now that inport with params is being deprecated, which is de right way of passing the publishDir output directory or the cpus to the subworkflows?

Until now I used in my subworkflows processes something like:

process my_subworkflow_process{
    cpus params.maxThreads
    publishDir  "${params.outdir}/something", mode: 'copy'
    ...
}
workflow my_subworkflow{
    my_subworkflow_process()
    ...
}

And in the parent workflow

include { my_subworkflow as msbwf} from './modules/my_subworkflow' params(params)

workflow{
    ...
    msbwf()
    ...
}


Hi @aCore , you should either move the publishDir to config (as is commonly done in nf-core) or migrate to workflow outputs. Workflow outputs are still in preview, but we plan to finalize it in 25.10 and I don’t expect the syntax to change.

At the same time, it might be a can of worms depending on how large your pipeline is, so you’ll have to judge which option makes more sense for your current situation. We will eventually deprecate publishDir in favor of workflow outputs, but that will take some time as we see what challenges remain with migrating large pipelines.

Thanks a lot for the advice. I took the route of moving publishDir to config.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.