Skip to content
Proud to collaborate with Microsoft for Startups

runner.cloud-run-job-reap ​

Reap orphaned Cloud Run Jobs (unreferenced, aged, non-shared) to reclaim regional quota

Delete orphaned Cloud Run Jobs so the regional quota cannot be exhausted.

Overview ​

PropertyValue
Workflow typeLinear
LibraryApp-runners-gcp
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes—UUID of the caller's organization, injected server-side from the authenticated request; scopes the sweep to the correct tenant.
runner_group_uuiduuidNo—Limit the sweep to one Cloud Run runner group (default: all in the org)
dry_runbooleanNo—Report without deleting. Defaults to TRUE — deletion must be opted into
max_deletionsintegerNo—Cap deletions per run (default 100, max 1000)
min_age_secondsintegerNo—Only reap Jobs older than this (default 7200s). Guards against deleting a Job whose launch is still in flight.
include_deleted_groupsbooleanNo—Also sweep soft-deleted runner groups (default TRUE). Their Jobs are unreachable by every other path — teardown never deletes them — so excluding them leaks the group's shared Job permanently. Honours config.delete_job_on_teardown per group.

Output Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidNo——
runner_group_uuiduuidNo——
dry_runbooleanNo—When true nothing was deleted; counts are what would be reaped
scanned_group_countintegerNo——
listed_job_countintegerNo——
candidate_countintegerNo—Jobs that passed every safety check
deleted_countintegerNo——
failed_countintegerNo——
protected_countintegerNo—Jobs skipped because they are shared or referenced by an active execution
too_young_countintegerNo—Jobs skipped by the age window (possibly mid-launch)
truncated_group_countintegerNo—Groups whose enumeration was incomplete; these are skipped entirely
deleted_group_countintegerNo—Soft-deleted groups swept; their shared Job is reapable because teardown never removed it
retained_by_teardown_flag_countintegerNo—Soft-deleted groups skipped because config.delete_job_on_teardown is false
cappedbooleanNo—True when max_deletions bounded the run — more remain to reap
deleted_job_nameslistNo——
completed_atstringNo——
failed_atstringNo——
max_deletionsintegerNo——
min_age_secondsintegerNo——
include_deleted_groupsbooleanNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
initiatedYesNo—reconcile—
reconcilingNoNo—complete—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
initiatedreconcilereconciling—
reconcilingcompletecompleted—
* (any state)failfailed—

API Usage ​

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

{
  "workflow_type": "runner.cloud-run-job-reap",
  "initial_data": {
    "organization_uuid": "value"
  }
}