LatchBio Integration
Current Baseline
This skill targets Latch SDK 2.76.8, released July 10, 2026. The package
metadata supports Python 3.9–3.12 and declares Python 3.9+.
Treat the installed package and its changelog as authoritative when a guide
disagrees with the SDK. Some Latch guides retain older Python ranges or
compatibility-specific pre-release pins, especially the Snakemake v2 tutorial.
Never combine commands or imports from different tracks without checking their
version requirements.
When to Use
Use this skill to:
- Create or maintain Python SDK workflows and task graphs
- Package and register Python, Nextflow, or Snakemake pipelines
- Configure task CPU, memory, storage, GPU, caching, retries, and timeouts
- Work with Latch Data through
LPath, LatchFile, LatchDir, or the CLI
- Read or update Latch Registry projects, tables, and records
- Design workflow forms, launch plans, samplesheets, messages, and result links
- Stage and debug workflow images with
latch register --staging and latch develop
- Launch and monitor workflows through Python or Latch MCP
- Discover and use ready-to-run Latch workflows
Route to the Right Reference
Read only the references needed for the task:
| Need |
Reference |
| Python workflows, tasks, maps, conditions, caching |
references/workflow-creation.md |
LPath, legacy file types, Latch URLs, data CLI |
references/data-management.md |
| Registry reads, transactions, samplesheets |
references/registry.md |
| CPU, memory, storage, GPU, dynamic resources |
references/resource-configuration.md |
| Nextflow and Snakemake packaging |
references/nextflow-snakemake.md |
| Metadata, forms, launch plans, messages, automations |
references/ui-and-automation.md |
| Registration, development, execution, monitoring |
references/operations-and-debugging.md |
Ready-to-use workflows and latch.verified |
references/verified-workflows.md |
| Remote MCP setup and tool workflow |
references/latch-mcp.md |
Before relying on a symbol, run scripts/inspect_latch_sdk.py against the
target SDK version. It performs local imports only and does not authenticate or
make network requests.
Installation and Authentication
For a reproducible environment:
uv venv --python 3.12
source .venv/bin/activate
uv pip install "latch==2.76.8"
On Windows, use WSL for the documented Linux workflow tooling.
Authenticate through the supported OAuth flow; do not read, print, copy, or
parse ~/.latch/token manually:
latch login
latch workspace
Select a workspace non-interactively when its numeric ID is already known:
latch workspace --id 12345
latch login credentials are for the SDK and CLI. Latch MCP uses a separate
OAuth authorization and its credentials cannot be reused for general SDK
access.
Fast Path
Create and remotely register the maintained subprocess template:
latch init covid-wf --template subprocess
latch register --yes --open covid-wf
Remote image building is the default. Use --no-remote only when a local
Docker daemon is available and a local build is intentional.
Minimal Python Workflow
Keep workflow bodies declarative: invoke tasks and return their promises.
Perform computation and side effects inside tasks.
from latch import small_task, workflow
@small_task
def reverse_complement(sequence: str) -> str:
table = str.maketrans("ACGTacgt", "TGCAtgca")
return sequence.translate(table)[::-1]
@workflow
def reverse_complement_workflow(sequence: str) -> str:
"""Return the reverse complement of a DNA sequence."""
return reverse_complement(sequence=sequence)
Use @workflow(metadata) when the generated interface needs custom labels,
sections, validation rules, samplesheets, or documentation links. Use LatchFile or
LatchDir for automatic task input staging and output upload; use LPath for
imperative remote path operations.
Recommended Development Lifecycle
Inspect compatibility
- Confirm the installed SDK and Python version.
- Identify whether the project is Python, Nextflow, the legacy Snakemake
flag path, or the separately pinned Snakemake v2 tutorial track.
Define a typed interface
- Annotate every workflow and task input and output.
- Keep module import time free of network calls, data mutations, and secret
retrieval. Isolate documented exceptions such as
workflow_reference,
which resolves the active workspace when its decorator is evaluated.
- Use dataclasses and enums for structured parameters.
Configure metadata and resources
- Match metadata parameter keys to the workflow signature.
- Start with named task decorators, then use
custom_task only when measured
requirements justify it.
Validate in the execution image
Fresh Nextflow and Snakemake projects must generate their
version-compatible Python entrypoint before staging. In SDK 2.76.8, the
staging branch does not generate one from --nf-script or --snakefile.
latch register --staging .
latch develop .
Re-run staging registration after changing the Dockerfile or dependencies.
Edits made inside the development container are not synced back.
Register deliberately
latch register --yes --open .
Useful controls:
latch register --workspace-id 12345 .
latch register --mark-as-release .
latch register --workflow-module wf.custom_entrypoint .
Duplicate registration exits with status 2; it is not the same as a build
failure.
Launch only after reviewing cost and parameters
- Prefer the Console or Latch MCP for interactive operation.
- Prefer
latch_cli.services.launch.launch_v2 for Python automation.
- Do not use the deprecated
latch launch CLI as a new integration pattern.
Monitor and verify
- Check terminal status, task logs, result links, and scientific outputs.
- Treat successful orchestration as necessary but not sufficient scientific
validation.
Operational Safety
- Ask for confirmation before launching paid compute, especially GPU or large
batch runs.
- Ask for confirmation before
LPath.rmr, latch rmr, Registry deletion, or
overwriting shared destinations.
- Never log secrets, SDK tokens, signed URLs, or secret values.
- Call
get_secret() only inside a task, use the returned value only for its
intended service, and never return it as workflow output.
- Do not pass untrusted strings through shell commands. Prefer argument lists
with
subprocess.run(..., check=True).
- Pin the SDK and workflow dependencies for releases. Upgrade only after
reviewing the changelog and re-running staging tests.
- Treat generated files as generated: customize the documented extension file
rather than editing output that the CLI will overwrite.
Inspect the Installed SDK
From this skill directory:
uv run --no-project --python 3.12 --with "latch==2.76.8" \
python scripts/inspect_latch_sdk.py
Use JSON output for automated comparisons:
uv run --no-project --python 3.12 --with "latch==2.76.8" \
python scripts/inspect_latch_sdk.py --json
Authoritative Sources
1---
2name: latchbio-integration
3description: Build, register, debug, and operate bioinformatics workflows on Latch using the Python SDK, CLI, Latch Data and Registry, Nextflow, Snakemake, programmatic execution, and Latch MCP. Use when authoring or deploying Latch workflows, configuring resources or interfaces, moving data, integrating Registry, or launching and monitoring runs.
4license: MIT
5allowed-tools: Read Write Edit Bash
6compatibility: Requires network access and a Latch account. The current stable SDK requires Python 3.9+; Python 3.12 is recommended. Uses uv for installation. Docker is needed for local image builds, while remote registration is the CLI default.
7metadata:
8 version: "2.0"
9 skill-author: K-Dense Inc.
10---
11
12# LatchBio Integration
13
14## Current Baseline
15
16This skill targets **Latch SDK 2.76.8**, released July 10, 2026. The package
17metadata supports Python 3.9–3.12 and declares Python 3.9+.
18
19Treat the installed package and its changelog as authoritative when a guide
20disagrees with the SDK. Some Latch guides retain older Python ranges or
21compatibility-specific pre-release pins, especially the Snakemake v2 tutorial.
22Never combine commands or imports from different tracks without checking their
23version requirements.
24
25## When to Use
26
27Use this skill to:
28
29- Create or maintain Python SDK workflows and task graphs
30- Package and register Python, Nextflow, or Snakemake pipelines
31- Configure task CPU, memory, storage, GPU, caching, retries, and timeouts
32- Work with Latch Data through `LPath`, `LatchFile`, `LatchDir`, or the CLI
33- Read or update Latch Registry projects, tables, and records
34- Design workflow forms, launch plans, samplesheets, messages, and result links
35- Stage and debug workflow images with `latch register --staging` and `latch develop`
36- Launch and monitor workflows through Python or Latch MCP
37- Discover and use ready-to-run Latch workflows
38
39## Route to the Right Reference
40
41Read only the references needed for the task:
42
43| Need | Reference |
44|---|---|
45| Python workflows, tasks, maps, conditions, caching | `references/workflow-creation.md` |
46| `LPath`, legacy file types, Latch URLs, data CLI | `references/data-management.md` |
47| Registry reads, transactions, samplesheets | `references/registry.md` |
48| CPU, memory, storage, GPU, dynamic resources | `references/resource-configuration.md` |
49| Nextflow and Snakemake packaging | `references/nextflow-snakemake.md` |
50| Metadata, forms, launch plans, messages, automations | `references/ui-and-automation.md` |
51| Registration, development, execution, monitoring | `references/operations-and-debugging.md` |
52| Ready-to-use workflows and `latch.verified` | `references/verified-workflows.md` |
53| Remote MCP setup and tool workflow | `references/latch-mcp.md` |
54
55Before relying on a symbol, run `scripts/inspect_latch_sdk.py` against the
56target SDK version. It performs local imports only and does not authenticate or
57make network requests.
58
59## Installation and Authentication
60
61For a reproducible environment:
62
63```bash
64uv venv --python 3.12
65source .venv/bin/activate
66uv pip install "latch==2.76.8"
67```
68
69On Windows, use WSL for the documented Linux workflow tooling.
70
71Authenticate through the supported OAuth flow; do not read, print, copy, or
72parse `~/.latch/token` manually:
73
74```bash
75latch login
76latch workspace
77```
78
79Select a workspace non-interactively when its numeric ID is already known:
80
81```bash
82latch workspace --id 12345
83```
84
85`latch login` credentials are for the SDK and CLI. Latch MCP uses a separate
86OAuth authorization and its credentials cannot be reused for general SDK
87access.
88
89## Fast Path
90
91Create and remotely register the maintained subprocess template:
92
93```bash
94latch init covid-wf --template subprocess
95latch register --yes --open covid-wf
96```
97
98Remote image building is the default. Use `--no-remote` only when a local
99Docker daemon is available and a local build is intentional.
100
101## Minimal Python Workflow
102
103Keep workflow bodies declarative: invoke tasks and return their promises.
104Perform computation and side effects inside tasks.
105
106```python
107from latch import small_task, workflow
108
109
110@small_task
111def reverse_complement(sequence: str) -> str:
112 table = str.maketrans("ACGTacgt", "TGCAtgca")
113 return sequence.translate(table)[::-1]
114
115
116@workflow
117def reverse_complement_workflow(sequence: str) -> str:
118 """Return the reverse complement of a DNA sequence."""
119 return reverse_complement(sequence=sequence)
120```
121
122Use `@workflow(metadata)` when the generated interface needs custom labels,
123sections, validation rules, samplesheets, or documentation links. Use `LatchFile` or
124`LatchDir` for automatic task input staging and output upload; use `LPath` for
125imperative remote path operations.
126
127## Recommended Development Lifecycle
128
1291. **Inspect compatibility**
130 - Confirm the installed SDK and Python version.
131 - Identify whether the project is Python, Nextflow, the legacy Snakemake
132 flag path, or the separately pinned Snakemake v2 tutorial track.
133
1342. **Define a typed interface**
135 - Annotate every workflow and task input and output.
136 - Keep module import time free of network calls, data mutations, and secret
137 retrieval. Isolate documented exceptions such as `workflow_reference`,
138 which resolves the active workspace when its decorator is evaluated.
139 - Use dataclasses and enums for structured parameters.
140
1413. **Configure metadata and resources**
142 - Match metadata parameter keys to the workflow signature.
143 - Start with named task decorators, then use `custom_task` only when measured
144 requirements justify it.
145
1464. **Validate in the execution image**
147
148 Fresh Nextflow and Snakemake projects must generate their
149 version-compatible Python entrypoint before staging. In SDK 2.76.8, the
150 staging branch does not generate one from `--nf-script` or `--snakefile`.
151
152 ```bash
153 latch register --staging .
154 latch develop .
155 ```
156
157 Re-run staging registration after changing the Dockerfile or dependencies.
158 Edits made inside the development container are not synced back.
159
1605. **Register deliberately**
161
162 ```bash
163 latch register --yes --open .
164 ```
165
166 Useful controls:
167
168 ```bash
169 latch register --workspace-id 12345 .
170 latch register --mark-as-release .
171 latch register --workflow-module wf.custom_entrypoint .
172 ```
173
174 Duplicate registration exits with status `2`; it is not the same as a build
175 failure.
176
1776. **Launch only after reviewing cost and parameters**
178 - Prefer the Console or Latch MCP for interactive operation.
179 - Prefer `latch_cli.services.launch.launch_v2` for Python automation.
180 - Do not use the deprecated `latch launch` CLI as a new integration pattern.
181
1827. **Monitor and verify**
183 - Check terminal status, task logs, result links, and scientific outputs.
184 - Treat successful orchestration as necessary but not sufficient scientific
185 validation.
186
187## Operational Safety
188
189- Ask for confirmation before launching paid compute, especially GPU or large
190 batch runs.
191- Ask for confirmation before `LPath.rmr`, `latch rmr`, Registry deletion, or
192 overwriting shared destinations.
193- Never log secrets, SDK tokens, signed URLs, or secret values.
194- Call `get_secret()` only inside a task, use the returned value only for its
195 intended service, and never return it as workflow output.
196- Do not pass untrusted strings through shell commands. Prefer argument lists
197 with `subprocess.run(..., check=True)`.
198- Pin the SDK and workflow dependencies for releases. Upgrade only after
199 reviewing the changelog and re-running staging tests.
200- Treat generated files as generated: customize the documented extension file
201 rather than editing output that the CLI will overwrite.
202
203## Inspect the Installed SDK
204
205From this skill directory:
206
207```bash
208uv run --no-project --python 3.12 --with "latch==2.76.8" \
209 python scripts/inspect_latch_sdk.py
210```
211
212Use JSON output for automated comparisons:
213
214```bash
215uv run --no-project --python 3.12 --with "latch==2.76.8" \
216 python scripts/inspect_latch_sdk.py --json
217```
218
219## Authoritative Sources
220
221- Documentation index: https://wiki.latch.bio/llms.txt
222- Workflow and SDK guides: https://wiki.latch.bio/workflows/overview
223- SDK API reference: https://wiki.latch.bio/reference/sdk
224- PyPI package: https://pypi.org/project/latch/
225- SDK 2.76.8 release source: https://github.com/latchbio/latch/tree/0faa9dcd8186444ac008f50adf95d43f0fa30e06
226- SDK changelog: https://github.com/latchbio/latch/blob/0faa9dcd8186444ac008f50adf95d43f0fa30e06/CHANGELOG.md
227- Latch Console: https://console.latch.bio