Skip to main content

Opentrons Flex

@vcjdeboer/opentrons-flexv2026.10.14.1· 1d agoBEHAVIORSWORKFLOWS
01README

Drive an Opentrons Flex robot from swamp. Pure HTTP against the robot's REST API — health, instruments, lights, runs, commands. Every method call is recorded in the swamp data layer, giving you a full provenance trail of what the robot did and when.

02Behaviors1
@vcjdeboer/opentrons-flexv2026.10.14.1opentrons_flex.ts

Global Arguments

ArgumentTypeDescription
hoststringHostname or IP of the robot. Prefer a literal IPv4 address — Deno's
port?numberRobot HTTP port. 31950 is the Opentrons default.
requestTimeoutMs?numberPer-request timeout in milliseconds.
commandSettleTimeoutMs?numberHow long to wait for a dispatched robot command to reach a terminal
opentronsVersion?stringValue for the opentrons-version header the robot requires.
fn health()
GET /health. Records whether the robot is reachable and what it
fn instruments()
GET /instruments. Records which pipettes and gripper are mounted,
fn lights(on?: boolean)
GET or set the robot's deck lights. Without arguments, reads the
ArgumentTypeDescription
on?booleanSet the lights on (true) or off (false). Omit to just read.
fn open_run()
POST /runs. Opens a run session on the robot. Returns the run id
fn close_run(runId: string)
Stop a run. Safe to call on one already stopped.
ArgumentTypeDescription
runIdstringThe run id to close.
fn home(runId: string)
Home the robot's gantry. Requires an open run (use open_run first).
ArgumentTypeDescription
runIdstringThe run id from open_run.
fn load_pipette(runId: string, pipetteName: string, mount: enum)
Load a pipette on a mount. Returns the pipetteId needed by
ArgumentTypeDescription
runIdstringThe run id from open_run.
pipetteNamestringEngine pipette name, e.g. p50_multi_flex, p1000_single_flex.
mountenumWhich mount to load on.
fn load_labware(runId: string, labwareDefinitionUri: string, slot: string)
Load labware into a deck slot. Returns the labwareId needed by
ArgumentTypeDescription
runIdstringThe run id from open_run.
labwareDefinitionUristringOpentrons labware URI, e.g. opentrons/nest_12_reservoir_15ml/1,
slotstringDeck slot, e.g. C1, D2, A1.
fn pick_up_tip(runId: string, pipetteId: string, labwareId: string, well?: string)
Pick up tips from a tip rack.
ArgumentTypeDescription
runIdstringThe run id from open_run.
pipetteIdstringThe pipetteId from load_pipette.
labwareIdstringThe labwareId of the tip rack.
well?stringWell to pick up from, e.g. A1.
fn aspirate(runId: string, pipetteId: string, labwareId: string, well?: string, volume: number, flowRate?: number)
Aspirate liquid from a well.
ArgumentTypeDescription
runIdstringThe run id from open_run.
pipetteIdstringThe pipetteId from load_pipette.
labwareIdstringThe labwareId of the source labware.
well?stringWell to aspirate from.
volumenumberVolume in µL.
flowRate?numberFlow rate in µL/s. Default 46 matches p50 flex defaults.
fn dispense(runId: string, pipetteId: string, labwareId: string, well?: string, volume: number, flowRate?: number)
Dispense liquid into a well.
ArgumentTypeDescription
runIdstringThe run id from open_run.
pipetteIdstringThe pipetteId from load_pipette.
labwareIdstringThe labwareId of the destination labware.
well?stringWell to dispense into.
volumenumberVolume in µL.
flowRate?numberFlow rate in µL/s.
fn drop_tip(runId: string, pipetteId: string, labwareId: string, well?: string)
Return tips to a loaded tip rack.
ArgumentTypeDescription
runIdstringThe run id from open_run.
pipetteIdstringThe pipetteId from load_pipette.
labwareIdstringThe labwareId of the tip rack.
well?stringWell to drop tips into.
fn trash_tip(runId: string, pipetteId: string, trashArea?: string)
Eject tips into the trash bin. Moves to the trash area and drops
ArgumentTypeDescription
runIdstringThe run id from open_run.
pipetteIdstringThe pipetteId from load_pipette.
trashArea?stringAddressable area name for the trash. Default is movableTrashA3.

Resources

health(infinite)— Whether the robot answers, and what it says it is
instruments(infinite)— Pipettes and gripper currently mounted
lights(infinite)— Current state of the robot's deck lights
run_session(infinite)— An open run on the robot — the session identity. Every command
command(infinite)— One command the robot accepted and settled: what was asked, what
03Workflows1
@vcjdeboer/opentrons-flex/flex-transfereba1e546-98c0-4d33-b607-d57ce894f7b1

Transfer liquid across four columns of a 96-well plate. Picks up tips once, aspirates and dispenses four times (A1→A1, A1→A2, A1→A3, A1→A4), then trashes the tips and homes.

setupOpen a run, home, and load all equipment
1.open-runlab-flex.open_run— Create a run session on the robot
2.home-startlab-flex.home— Home all axes
3.load-pipettelab-flex.load_pipette— Load p50 8-channel on right mount
4.load-tipracklab-flex.load_labware— Load 50 µL tip rack in slot B2
5.load-reservoirlab-flex.load_labware— Load NEST 12 reservoir in slot C1
6.load-platelab-flex.load_labware— Load 96-well plate in slot D2
transferPick up tips, transfer 30 µL across three columns, trash tips
1.pick-up-tipslab-flex.pick_up_tip— Pick up 8 tips from column 1
2.aspirate-col1lab-flex.aspirate— Aspirate 50 µL from reservoir A1
3.dispense-col1lab-flex.dispense— Dispense 50 µL into plate column 1
4.aspirate-col2lab-flex.aspirate— Aspirate 50 µL from reservoir A1
5.dispense-col2lab-flex.dispense— Dispense 50 µL into plate column 2
6.aspirate-col3lab-flex.aspirate— Aspirate 50 µL from reservoir A1
7.dispense-col3lab-flex.dispense— Dispense 50 µL into plate column 3
8.aspirate-col4lab-flex.aspirate— Aspirate 50 µL from reservoir A1
9.dispense-col4lab-flex.dispense— Dispense 50 µL into plate column 4
10.trash-tipslab-flex.trash_tip— Eject tips into trash
teardownHome and close the run
1.home-endlab-flex.home— Return gantry to home
2.close-runlab-flex.close_run— Close the run session
04Previous Versions1
2026.10.12.1
05Stats
A
93 / 100
Downloads
1
Archive size
13.4 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License1/2partial

    no SPDX license declared

  • Verified public repository2/2earned
06Platforms