Skip to main content

Overview

The Latch platform uses metadata objects to define and customize workflow interfaces. If you are using the Python SDK, you can define the metadata object in your workflow code. If you are using Nextflow or Snakemake, the metadata object is auto-generated from the nextflow_json.schema or config.yaml file using the latch generate-metadata command. This document provides a comprehensive reference for all metadata types available in the Latch SDK.

Examples

Visit a few examples that our engineers have curated below:

nf-core/atacseq

ATAC-seq peak-calling and QC analysis pipeline, uploaded using the Nextflow SDK. Workflow UI Source Code

Boltz-2

A biomolecular foundation model that jointly predicts structure and binding affinity, uploaded using the Python SDK. Workflow UI Source Code

Core Metadata Classes

LatchMetadata

The primary metadata class for Python SDK workflows.

Parameters

  • display_name (str): The human-readable name of the workflow
  • author (LatchAuthor): Author information for the workflow
  • documentation (str, optional): Link to workflow documentation
  • repository (str, optional): Link to source code repository
  • license (str): SPDX license identifier (default: “MIT”)
  • parameters (Dict[str, LatchParameter]): Parameter definitions
  • wiki_url (str, optional): Link to wiki documentation
  • video_tutorial (str, optional): Link to video tutorial
  • tags (List[str]): Tags for workflow discovery
  • flow (List[FlowBase]): Custom parameter layouts
  • no_standard_bulk_execution (bool): Disable standard CSV bulk execution
  • about_page_path (Path, optional): Path to about page markdown file

NextflowMetadata

Metadata class for Nextflow workflows.

Parameters

  • display_name (str): Workflow display name
  • author (LatchAuthor): Author information
  • parameters (Dict[str, NextflowParameter]): Parameter definitions
  • runtime_resources (NextflowRuntimeResources): Resource configuration
  • execution_profiles (List[str]): Available execution profiles
  • log_dir (LatchDir, optional): Directory for workflow logs
  • upload_command_logs (bool): Upload command logs to Latch Data

SnakemakeMetadata

Metadata class for Snakemake workflows.

Parameters

  • display_name (str): Workflow display name
  • author (LatchAuthor): Author information
  • parameters (Dict[str, SnakemakeParameter]): Parameter definitions
  • file_metadata (FileMetadata): File-specific metadata
  • output_dir (LatchDir, optional): Output directory location
  • docker_metadata (DockerMetadata, optional): Docker credentials
  • env_config (EnvironmentConfig): Environment configuration
  • cores (int): Number of cores for Snakemake tasks
  • about_page_content (Path, optional): Path to about page content

Parameter Classes

LatchParameter

Base parameter class for Python SDK workflows.

Parameters

  • display_name (str, optional): Human-readable parameter name
  • description (str, optional): Parameter description/tooltip
  • hidden (bool): Whether parameter is hidden by default
  • section_title (str, optional): Section grouping title
  • placeholder (str, optional): Placeholder text for input
  • comment (str, optional): Additional comment text
  • output (bool): Whether parameter is an output
  • batch_table_column (bool): Show in batch mode table
  • allow_dir (bool): Accept directories in UI
  • allow_file (bool): Accept files in UI
  • appearance_type (LatchAppearance): UI appearance type
  • rules (List[LatchRule]): Validation rules
  • detail (str, optional): Secondary label text
  • samplesheet (bool, optional): Enable samplesheet input
  • allowed_tables (List[int], optional): Allowed registry tables

NextflowParameter

Parameter class for Nextflow workflows.

Parameters

  • type (Type[T], optional): Expected parameter type
  • display_name (str, optional): Parameter display name
  • description (str, optional): Parameter description
  • default (T, optional): Default parameter value
  • samplesheet (bool, optional): Enable samplesheet input
  • samplesheet_type (Literal[“csv”, “tsv”, None]): Samplesheet format
  • samplesheet_constructor (Callable[[T], Path], optional): Custom constructor
  • results_paths (List[Path], optional): Output sub-paths for UI

SnakemakeParameter

Parameter class for Snakemake workflows.

Parameters

  • type (Type[T], optional): Expected parameter type
  • display_name (str, optional): Parameter display name
  • description (str, optional): Parameter description
  • default (T, optional): Default parameter value

Organization of Parameters into Sections

By default, all parameters are rendered from top to bottom on the workflow UI, in the order they are defined in the metadata object. This can be overwhelming for end users if workflows have dozens or hundreds of parameters. To make the UI more user-friendly, you can organize parameters into Sections and take advantage of elements like Spoiler or Fork to collapse advanced parameters.

Custom Flows

Define custom parameter layouts using flow elements:

Appearance Customization

Customize parameter appearance:

Flow Elements

Section

Flow element that displays child flow in a titled card.

Text

Flow element that displays markdown text.

Title

Flow element that displays a markdown title.

Params

Flow element that displays parameter widgets.

Spoiler

Flow element that displays a collapsible card.

Fork

Flow element that displays mutually exclusive alternatives.

Supporting Classes

LatchAuthor

Author information for workflows.

LatchRule

Validation rule for parameter inputs.

LatchAppearance

Parameter appearance configuration.

SnakemakeFileMetadata

File-specific metadata for Snakemake workflows.

NextflowRuntimeResources

Resource configuration for Nextflow runtime tasks.

DockerMetadata

Credentials for private Docker repositories.

EnvironmentConfig

Environment configuration for Snakemake tasks.

Type System

Supported Parameter Types

Type Validation

The SDK automatically validates parameter types based on:
  • Function signature type annotations
  • Metadata parameter definitions
  • Runtime value validation
  • Custom validation rules via LatchRule

Samplesheet Support

Basic Samplesheet

Custom Samplesheet Constructor

SamplesheetItems

Often when populating a samplesheet parameter using rows from Registry, it is useful to have access to the originating record that created the row. Wrapping a samplesheet type with the SamplesheetItem marker allows downstream code to easily access this underlying record.

Validation and Rules

Regex Validation

Multiple Rules