Skip to content
Proud to collaborate with Microsoft for Startups

runner.pool-drain ​

Drain every alive runner instance in a warm-pool group (PENDING/IDLE/BUSY → DRAINING). BUSY instances finish their current job first. Org-scoped. Reason is recorded on each instance's transition event for audit.

Drain every warm-pool instance in a group.

IDLE and PENDING instances go straight to DRAINING. BUSY instances enter DRAINING immediately too; their currently-running job completes, then the workflow_job:completed handler skips the IDLE transition (Phase 4 logic) and the next sweep terminates them.

Replacement runners are NOT provisioned by this workflow — call runner.pool-rotate if you need drain + immediate top-up.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-runners
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
runner_group_uuiduuidYes—UUID of the RunnerGroup to drain, picked from the organization's list of runner groups.
reasonstringNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
runner_group_uuiduuidNo—UUID of the RunnerGroup that was drained, echoed from input on output.
drained_countintegerNo——
drain_errorslistNo——
outcomestringNo——
statusstringNo——
completed_atstringNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——
reasonstringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—drain—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingdraincompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "runner.pool-drain",
  "initial_data": {
    "runner_group_uuid": "value"
  }
}