The default option for Nextflow is to start a workflow from the beginning. When a few processes have failed, you often want instead to resume from the last successfully completed processes. This can be done by using -resume
on the command line. An alternative is placing the following statement in your nextflow.config
, which enables the -resume
behaviour by default.
resume = true
However there are times when you only want this behaviour for certain processes. Here you can use Nextflow’s powerful selector expressions to disable caching for certain processes, for example by negating a match to a process name, or using wildcards or grouping to select a subset of processes to disable caching.
resume = true
process {
withName: '!TASK' {
cache = false // Only -resume for process TASK
}
}
or:
resume = true
process {
withName: '.*:SUBWORKFLOW:(TASK1|TASK2)' {
cache = false // TASK1 and TASK2 in SUBWORKFLOW should always restart
}
}