Handling single sample failures


I have been looking into the different error handling modes of nextflow, but I’m not sure if one exists that does what I want.

I run a large number of samples, and occasionally a single one of them will fail because the input file is misformatted or empty.

Is it possible to have Nextflow continue with the rest of the samples and then simply make a list of the failed samples afterwards?


Yes, you can have Nextflow decide what to do (abort? ignore? retry?) when facing a task failure with the errorStrategy process directive. You can read more about it here. It’s a very powerful feature. Check some nice examples here, in our community training material :wink:

As for printing a list of the failed samples, there’s no such feature by default, but you can get this based on log/trace files and the tag process directive.

I believe @adabnz is referring to the idea that you might complete the pipeline except for the failed sample. See the issue here and PR here.

Short answer is this isn’t possible without custom code yet, but should be available in an upcoming release!