Skip to main content

What is the Latch SDK?

The Python SDK lets you define computational workflows in Python, package them into Docker images, and run them on LatchBio’s managed infrastructure.
It provides:
  • A Python API for defining tasks (individual steps) and workflows (task graphs)
  • Instant no-code interfaces for accessibility and publication
  • Containerization and versioning of every registered change
  • Reliable and scalable managed cloud infrastructure
  • Single line definition of arbitrary resource requirements (eg. CPU, GPU) for serverless execution
  • Programmatic API endpoints for running workflows

Workflows as DAGs

A workflow is a series of connected tasks, represented internally as a directed acyclic graph (DAG). Each task is a Python function that:
  • Declares its inputs via function parameters
  • Returns outputs that can be passed to downstream tasks
  • Contains any processing logic (Python or subprocess calls to other tools)
Example:
@small_task
def assembly_task(read1: LatchFile, read2: LatchFile) -> LatchFile:
    # run bowtie2...
    return LatchFile("covid_assembly.sam", "latch:///covid_assembly.sam")

@workflow
def assemble_and_sort(read1: LatchFile, read2: LatchFile) -> LatchFile:
    sam = assembly_task(read1=read1, read2=read2)
    return sort_bam_task(sam=sam)

Next Steps

  • Visit Quick Start to upload your first Python workflow in under 5 minutes.
  • Visit Tutorial to understand how to author your workflow in details.
  • Visit UI for more details on how to customize your workflow interface.
I