Every Nextflow workflow registered on Latch has an underlying Latch SDK workflow that orchestrates the execution of the Nextflow pipeline. This Latch SDK workflow is defined as a Python script which is generated from the latch_metadata file when the workflow is registered.

When developing Nextflow workflows on Latch, users may want to customize their workflow by updating the generated Latch SDK workflow code. For example, developers may want to do some additional post-processing to their workflow outputs or provide additional customization to their workflow interface as described here. Before making any changes, to the entrypoint.py file, we highly reccommend reviewing the workflow documentation to understand how Latch workflow are authored.

To support this, the Latch SDK provides a command to generate the Latch SDK workflow code that executes the Nextflow pipeline:

latch nextflow generate-entrypoint . --nf-script main.nf --execution-profile docker

This command generates two files:

  1. latch.config - a Nextflow configuration file passed to Nextflow via the -config flag.
  2. wf/custom_entrypoint.py - the generated Latch SDK workflow code that executes the Nextflow pipeline.

We can now modify these files and register the updated workflow by running the following commmand.

We purposely exclude the --nf-script flag in the latch register command to avoid re-generating the Latch SDK workflow code.

latch register .