Overview

The LaunchPlan class allows you to create named groups of default parameters for your workflows. This enables users to quickly launch workflows with predefined parameter sets, making it easier to get started with common use cases.

Constructor

LaunchPlan(
    workflow: PythonFunctionWorkflow,
    name: str,
    default_params: dict[str, Any],
    *,
    description: str | None = None,
)

Parameters

  • workflow (PythonFunctionWorkflow): The workflow function to which the default values apply. This is the function decorated with @workflow (See example)
  • name (str): A semantic identifier for the parameter values (e.g., ‘Small Data’, ‘Production Run’)
  • default_params (dict[str, Any]): A mapping of parameter names to their default values.
  • description (str, optional): A description of what this launch plan represents.

Usage

LaunchPlan(
    nf_nf_core_methylseq,
    "Test Data",
    {
        "input": [
            Sample(
                sample="SRR389222_sub1",
                fastq_1=LatchFile(
                    "s3://latch-public/nf-core/methylseq/test_data/SRR389222_sub1.fastq.gz"
                ),
                fastq_2=None,
            ),
            Sample(
                sample="SRR389222_sub2",
                fastq_1=LatchFile(
                    "s3://latch-public/nf-core/methylseq/test_data/SRR389222_sub2.fastq.gz"
                ),
                fastq_2=None,
            ),
            Sample(
                sample="SRR389222_sub3",
                fastq_1=LatchFile(
                    "s3://latch-public/nf-core/methylseq/test_data/SRR389222_sub3.fastq.gz"
                ),
                fastq_2=None,
            ),
            Sample(
                sample="Ecoli_10K_methylated",
                fastq_1=LatchFile(
                    "s3://latch-public/nf-core/methylseq/test_data/Ecoli_10K_methylated_R1.fastq.gz"
                ),
                fastq_2=LatchFile(
                    "s3://latch-public/nf-core/methylseq/test_data/Ecoli_10K_methylated_R2.fastq.gz"
                ),
            ),
        ],
        "run_name": "Test_Run",
        "genome_source": "custom",
        "fasta": LatchFile("s3://latch-public/nf-core/methylseq/test_data/genome.fa"),
        "fasta_index": LatchFile(
            "s3://latch-public/nf-core/methylseq/test_data/genome.fa.fai"
        ),
    },
)

# Add more launch plans here...

Example

See a full example of how LaunchPlan is used in the nf-core/methylseq workflow.

How It Works

  1. When you register your workflow, the launch plans are automatically created
  2. The default parameters appear under the “Test Data” dropdown button in the Latch Console.
  3. Users can select a launch plan to pre-populate the workflow form
  4. Users can still modify any of the pre-filled parameters before execution

Summary

The LaunchPlan class provides a powerful way to create predefined parameter sets for your workflows, improving the user experience by:
  • Reducing setup time with pre-configured parameters
  • Providing guidance on appropriate parameter values
  • Supporting multiple use cases with different launch plans
  • Maintaining flexibility for users to customize as needed
By creating well-named and well-described launch plans, you can make your workflows more accessible to users with different levels of expertise and different use case requirements.