To enable developers to easily debug failed Nextflow workflows on Latch, the Latch SDK provides support for inspecting the contents of an execution’s work directory. This allows users to inspect/create/update files in the work directory and relaunch the workflow using the updated state.

Note: Once an execution’s work directory has expired, it can no longer be inspected. See Caching and Resuming for information on how to extend the expiration of an execution’s work directory.

To get started, verify that you are using latch >= 2.53.8.

latch --version

To debug an execution, run the following command:

latch nextflow attach

This will prompt you to select the name of the execution you wish to debug:

After selecting an execution, the Latch SDK will connect you to a container containing the contents of that execution’s work directory. The work directory is mounted under /nf-workdir inside the container. Once you are connected, you can inspect, create, and/or update files. Any changes made inside the container will be reflected in the work directory of the execution.