Overview
On Latch, the workflow interface is defined in the__init__.py file within the latch_metadata folder of your workflow. This file instantiates a SnakemakeV2Metadata object that specifies the interface.
When the workflow runs, this metadata is automatically serialized to JSON and passed to your Snakemake pipeline as an external config file. This means any reference to config in your Snakefile is seamlessly populated with values from the interface—no extra setup required.
This document explains how parameter values from the interface are encoded into the config file.
Primitive Types
Workflow parameter values are encoded in the following manner. Primitives such asints, floats, and strs are encoded normally, as shown below.
Collection Types
Collection types likelists and dicts are also encoded normally, e.g.
Dataclasses
Dataclasses are encoded the same asdicts, where field names become keys and field values become values. For example, the following dataclass definition and value
LatchFile and LatchDir
LatchFiles and LatchDirs are encoded as specially formatted /ldata strings. For example