SCALE FROM ZERO WORKERS
This guide shows you how to submit work to an orchestrator with no connected workers and have steps dispatch automatically when a worker connects.
Prerequisites
You need a running orchestrator (swamp serve). No workers need to be connected
— that is the point.
Submit a placed workflow
Create a workflow with a placement requirement:
jobs:
- name: work
steps:
- name: process
task:
type: model_method
modelIdOrName: my-model
methodName: run
labels:
pool: on-demandRun it:
swamp workflow run scale-testThe workflow starts, but the step cannot dispatch because no connected worker
matches pool=on-demand. The step enters the queue.
Check the queue
swamp worker queueREQUIREMENT STEP MODEL QUEUED AT AGE
labels pool=on-demand process my-model 2026-07-07T12:00:00.000Z 10sThe step remains queued until a matching worker connects or the queue timeout expires.
Connect a worker
In a separate terminal, connect a worker with the matching label:
swamp worker connect wss://localhost:9090 \
--token on-demand-worker.<secret> \
--label pool=on-demandThe step dispatches immediately. The orchestrator evaluates queued steps on every enrollment event — there is no polling delay.
Verify the workflow completed:
swamp workflow status scale-testConfigure the queue timeout
If no worker connects within the timeout, the queued step fails. The default is 10 minutes.
To change the global default, pass --queue-timeout to swamp serve:
swamp serve --queue-timeout 30mTo override per step, set queueTimeout in the workflow:
- name: process
task:
type: model_method
modelIdOrName: my-model
methodName: run
labels:
pool: on-demand
queueTimeout: 0A queueTimeout of 0 disables the timeout entirely — the step queues
indefinitely until a matching worker connects or the workflow is cancelled. Use
this when an external system (an autoscaler, a CI trigger) is responsible for
starting workers and is guaranteed to eventually provide one.
Refer to Workflow Placement for the full placement and queueing reference.
Related
- Run a Fleet with Docker Compose — deploy workers that can be scaled up on demand
- Run a Fleet on Kubernetes — deploy workers as a Kubernetes Deployment or Job
- Worker Fleets — design rationale behind elastic queueing
- Worker Commands — full CLI reference