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 asint
s, float
s, and str
s are encoded normally, as shown below.
Collection Types
Collection types likelist
s and dict
s are also encoded normally, e.g.
Dataclasses
Dataclasses are encoded the same asdict
s, where field names become keys and field values become values. For example, the following dataclass definition and value
LatchFile and LatchDir
LatchFile
s and LatchDir
s are encoded as specially formatted /ldata
strings. For example