Waiting for a slot, weight and heavy runs
Seven runs that each open 16 parallel steps, started together on a machine with 16 slots, used to fight for the same slots: all slow, some timing out before they even started. With a weight of 16, one or two run at a time at full speed and all seven finish.
- Why a step never times out while it waits for a slot
- Give a script or flow a weight, or pass one for a single run
- How heavy runs wait their turn and run alone
- See who waits for a slot, and cap a worker group
Waiting is not running
A step’s time limit — and a subflow’s — starts when a worker takes it, never when it was queued. A step that waits ten minutes for a slot and then runs for one minute finishes, whatever its limit. A flow that waits for a subflow or a step on another machine gives its own slot back while it waits.
To give up after waiting too long, set the longest wait in the queue on a script, a flow or a step (Triggers tab → Limits, or queueTimeoutSecs on a step). Past it, a run that never started fails with queue_timeout. Empty means it waits as long as it takes.
Give a run its weight
A weight is how many worker slots one run may use at once. Set it on a script or flow in the Triggers tab → Limits: a fixed number, or from an input (for example processCount, at most 16). Whoever starts a run — the API, the MCP or another script — may pass a weight for that one run instead.
import waiso
def main(office: int, processes: int):
# This regeneration opens up to 16 comparisons at once: ask for 16 slots.
# It waits — holding no slot — until 16 are free, then runs at full speed.
return waiso.run_flow("collisions/regenerate", {"office": office}, weight=min(processes, 16)).output| Waiso admits a weighted run when | Otherwise |
|---|---|
| its weight fits the free capacity: the group’s slots, minus the weights already admitted, minus the slots busy with work that has no weight | it waits as “Waiting for a slot”, holding no slot |
| it is first in line (higher priority first, then oldest) | it waits behind the run ahead of it — even if it would fit |
- A run never holds more slots than its weight; its steps and subflows are part of it, never weighed again.
- A run that reschedules or waits for an approval gives its weight back until it resumes.
- Runs with no weight behave as always.
Heavy runs run alone
A weight bigger than what is free is never refused. The run waits for the runs already admitted to finish; runs that arrive after it wait behind it, so it is never overtaken. A weight bigger than the whole machine is admitted as soon as nothing else weighted runs, and nothing else weighted is admitted until it ends.
See who waits for a slot
The Runs page shows a waiting run with “Waiting for a slot · needs 16, 4 free”, or “behind another run”. The Platform API and the MCP (get_run, list_runs) return waitingReason: "capacity" with weight, capacity, freeCapacity and waitingBehind. Agents set weights with update_script / update_flow and pass one with run_script / run_flow.