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 ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-runners-gcp |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | UUID of the caller's organization, injected server-side from the authenticated request; scopes the sweep to the correct tenant. |
runner_group_uuid | uuid | No | — | Limit the sweep to one Cloud Run runner group (default: all in the org) |
dry_run | boolean | No | — | Report without deleting. Defaults to TRUE — deletion must be opted into |
max_deletions | integer | No | — | Cap deletions per run (default 100, max 1000) |
min_age_seconds | integer | No | — | Only reap Jobs older than this (default 7200s). Guards against deleting a Job whose launch is still in flight. |
include_deleted_groups | boolean | No | — | 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 ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | No | — | — |
runner_group_uuid | uuid | No | — | — |
dry_run | boolean | No | — | When true nothing was deleted; counts are what would be reaped |
scanned_group_count | integer | No | — | — |
listed_job_count | integer | No | — | — |
candidate_count | integer | No | — | Jobs that passed every safety check |
deleted_count | integer | No | — | — |
failed_count | integer | No | — | — |
protected_count | integer | No | — | Jobs skipped because they are shared or referenced by an active execution |
too_young_count | integer | No | — | Jobs skipped by the age window (possibly mid-launch) |
truncated_group_count | integer | No | — | Groups whose enumeration was incomplete; these are skipped entirely |
deleted_group_count | integer | No | — | Soft-deleted groups swept; their shared Job is reapable because teardown never removed it |
retained_by_teardown_flag_count | integer | No | — | Soft-deleted groups skipped because config.delete_job_on_teardown is false |
capped | boolean | No | — | True when max_deletions bounded the run — more remain to reap |
deleted_job_names | list | No | — | — |
completed_at | string | No | — | — |
failed_at | string | No | — | — |
max_deletions | integer | No | — | — |
min_age_seconds | integer | No | — | — |
include_deleted_groups | boolean | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
initiated | Yes | No | — | reconcile | — |
reconciling | No | No | — | complete | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
initiated | reconcile | reconciling | — |
reconciling | complete | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "runner.cloud-run-job-reap",
"initial_data": {
"organization_uuid": "value"
}
}