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 thenextflow_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 workflowauthor
(LatchAuthor): Author information for the workflowdocumentation
(str, optional): Link to workflow documentationrepository
(str, optional): Link to source code repositorylicense
(str): SPDX license identifier (default: “MIT”)parameters
(Dict[str, LatchParameter]): Parameter definitionswiki_url
(str, optional): Link to wiki documentationvideo_tutorial
(str, optional): Link to video tutorialtags
(List[str]): Tags for workflow discoveryflow
(List[FlowBase]): Custom parameter layoutsno_standard_bulk_execution
(bool): Disable standard CSV bulk executionabout_page_path
(Path, optional): Path to about page markdown file
NextflowMetadata
Metadata class for Nextflow workflows.
Parameters
display_name
(str): Workflow display nameauthor
(LatchAuthor): Author informationparameters
(Dict[str, NextflowParameter]): Parameter definitionsruntime_resources
(NextflowRuntimeResources): Resource configurationexecution_profiles
(List[str]): Available execution profileslog_dir
(LatchDir, optional): Directory for workflow logsupload_command_logs
(bool): Upload command logs to Latch Data
SnakemakeMetadata
Metadata class for Snakemake workflows.
Parameters
display_name
(str): Workflow display nameauthor
(LatchAuthor): Author informationparameters
(Dict[str, SnakemakeParameter]): Parameter definitionsfile_metadata
(FileMetadata): File-specific metadataoutput_dir
(LatchDir, optional): Output directory locationdocker_metadata
(DockerMetadata, optional): Docker credentialsenv_config
(EnvironmentConfig): Environment configurationcores
(int): Number of cores for Snakemake tasksabout_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 namedescription
(str, optional): Parameter description/tooltiphidden
(bool): Whether parameter is hidden by defaultsection_title
(str, optional): Section grouping titleplaceholder
(str, optional): Placeholder text for inputcomment
(str, optional): Additional comment textoutput
(bool): Whether parameter is an outputbatch_table_column
(bool): Show in batch mode tableallow_dir
(bool): Accept directories in UIallow_file
(bool): Accept files in UIappearance_type
(LatchAppearance): UI appearance typerules
(List[LatchRule]): Validation rulesdetail
(str, optional): Secondary label textsamplesheet
(bool, optional): Enable samplesheet inputallowed_tables
(List[int], optional): Allowed registry tables
NextflowParameter
Parameter class for Nextflow workflows.
Parameters
type
(Type[T], optional): Expected parameter typedisplay_name
(str, optional): Parameter display namedescription
(str, optional): Parameter descriptiondefault
(T, optional): Default parameter valuesamplesheet
(bool, optional): Enable samplesheet inputsamplesheet_type
(Literal[“csv”, “tsv”, None]): Samplesheet formatsamplesheet_constructor
(Callable[[T], Path], optional): Custom constructorresults_paths
(List[Path], optional): Output sub-paths for UI
SnakemakeParameter
Parameter class for Snakemake workflows.
Parameters
type
(Type[T], optional): Expected parameter typedisplay_name
(str, optional): Parameter display namedescription
(str, optional): Parameter descriptiondefault
(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 intoSection
s 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
SamplesheetItem
s
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.