Threads
A thread represents one piece of labware's journey through your system.
ThreadTemplate
Import from orca.sdk.workflow:
from orca.sdk.workflow import ThreadTemplate
plate_thread = ThreadTemplate(
labware_template=sample_plate,
start=input_stack,
end=output_stack,
methods=[dispense_method, seal_method, read_method]
)
Parameters
| Parameter | Type | Description |
|---|---|---|
labware_template | LabwareTemplate | The labware this thread processes |
start | Location | Where the labware starts |
end | Location | Where the labware ends |
methods | List[IMethodTemplate] | Methods to execute in order (default: []) |
Properties
name- Thread name (derived from labware template name)labware_template- The labware templatestart_location- Starting locationend_location- Ending locationmethod_resolvers- List of method templates
Methods
add_method(method)- Add a method to the endadd_methods(methods)- Add multiple methods
Thread Execution
When a thread runs:
- Labware starts at the
startlocation - For each method:
- Transporter picks labware from current location
- Transporter places labware at method's device
- All actions in the method execute
- Transporter moves labware to
endlocation
Thread: sample_plate
│
▼
┌─────────────────────────┐
│ Start: input_stack │
└───────────┬─────────────┘
│ pick
▼
┌─────────────────────────┐
│ Method 1: dispense │ ◀── place, execute, pick
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ Method 2: seal │ ◀── place, execute, pick
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ Method 3: read │ ◀── place, execute, pick
└───────────┬─────────────┘
│ place
▼
┌─────────────────────────┐
│ End: output_stack │
└─────────────────────────┘
Parallel Threads
Multiple threads run concurrently. Each thread processes its own labware independently:
Thread A: ───[dispense]───[seal]───[read]────────────▶
Thread B: ─────────[dispense]───[seal]───[read]──────▶
Thread C: ───────────────[dispense]───[seal]───[read]▶
The scheduler coordinates resource access. If two threads need the same device, one waits.
Locations
Locations are named positions in your system. Get locations from the SystemMap:
from orca.sdk.system import SystemMap
system_map = SystemMap(registry)
system_map.assign_resources({
"input_stack": storage_device,
"output_stack": storage_device,
"shaker": shaker,
})
input_stack = system_map.get_location("input_stack")
output_stack = system_map.get_location("output_stack")
Location names correspond to teachpoint names in your transporter configuration.
Example: Complete Thread Setup
from orca.sdk.labware import PlateTemplate
from orca.sdk.workflow import MethodTemplate, ThreadTemplate
from orca.sdk.actions import Shake, Seal
# Define labware
sample_plate = PlateTemplate("sample_plate", plate_factory, None)
# Define methods
shake_method = MethodTemplate("shake", [
Shake(resource=shaker, duration=60, speed=500, inputs=[sample_plate], outputs=[sample_plate])
])
seal_method = MethodTemplate("seal", [
Seal(resource=sealer, temperature=165, duration=5, inputs=[sample_plate], outputs=[sample_plate])
])
# Define thread
plate_thread = ThreadTemplate(
labware_template=sample_plate,
start=system_map.get_location("input_stack"),
end=system_map.get_location("output_stack"),
methods=[shake_method, seal_method]
)
Next Steps
- Workflows - Coordinate multiple threads
- Methods - Group actions into methods
- System Building - Configure locations and registry