Latch supports Nextflow execution profiles which allows users to group related configuration parameters. Users can specify which configuration profile to use when running their pipeline statically at registration time or dynamically when launching their workflow in the Latch UI.

Configuring profiles at workflow registration

To specify an execution profile to use when running the workflow on Latch, pass the --nf-execution-profile flag to the latch register command.

For example, to specify the docker profile:

latch register . --nf-script main.nf --nf-execution-profile docker

The execution profile specified will be hidden from the user on the frontend, and cannot be changed without re-registering the workflow.

Configuring profiles at workflow execution

To enable users to dynamically select an execution profile when launching a workflow, use the execution_profiles parameter in the NextflowMetadata object as follows:

from latch.types.metadata import (
    NextflowMetadata,
    LatchAuthor,
    NextflowRuntimeResources
)
from latch.types.directory import LatchDir

from .parameters import generated_parameters

NextflowMetadata(
    display_name='Workflow Name',
    author=LatchAuthor(
        name="Your Name",
    ),
    parameters=generated_parameters,
    execution_profiles=["docker", "test"], # ADDED
    log_dir=LatchDir("latch:///your_log_dir"),
)

This will generate the following dropdown in the Latch UI, enabling users to select a subset of the execution profiles provided when launching the workflow: