kubernetes.resource.wait_for_condition ​
Generic kubectl-wait equivalent: poll any Kubernetes resource until a condition matches the requested status
Generic kubectl-wait equivalent: poll any Kubernetes resource until a named condition matches the requested status.
The workflow uses the CustomObjectsApi client which works across all resource kinds — core (v1), named API groups (apps/v1, batch/v1, …), and CRDs — without needing a typed client per resource type.
4-state polling pattern:
PENDING (auto_advance="start_polling") → WAITING (re-polls via schedule_transition) → COMPLETED matched=True (condition reached) → COMPLETED matched=False (timeout) → FAILED (unexpected exception)
Kind-to-plural mapping:
"Deployment" → "deployments", "Policy" → "policies", "Ingress" → "ingresses", "MyCustomKind" → "mycustomkinds"
Inputs:
- connection_uuid: UUID of the cloud connection (required)
- api_version: API group/version string, e.g. "v1", "apps/v1", "batch/v1" (required)
- kind: Resource kind, e.g. "Deployment", "Pod", "MyCustomKind" (required)
- name: Resource name (required)
- namespace: Namespace for namespaced resources; omit for cluster-scoped (optional)
- condition_type: Condition type to watch, e.g. "Ready", "Available" (required)
- condition_status: Expected condition status: "True", "False", or "Unknown" (optional, default "True")
- timeout_seconds: Maximum total wait in seconds (optional, default 300, cap 1800)
- poll_interval: Seconds between polls (optional, default 5, cap 60)
Outputs:
- matched: bool — True if condition reached; False on timeout
- poll_count: int — number of polls executed
- last_observed_status: JSON — last raw status.conditions list
Plugin required: context.get_plugin("connection").kubernetes_runner_clients(connection_uuid, organization_uuid) must expose custom_objects (kubernetes.client.CustomObjectsApi).
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-kubernetes |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | Yes | — | — |
api_version | string | Yes | — | — |
kind | string | Yes | — | — |
name | string | Yes | — | — |
namespace | string | No | — | — |
condition_type | string | Yes | — | — |
condition_status | string | No | — | — |
timeout_seconds | integer | No | — | — |
poll_interval | integer | No | — | — |
organization_uuid | uuid | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | — |
organization_uuid | uuid | No | — | — |
api_version | string | No | — | — |
kind | string | No | — | — |
name | string | No | — | — |
namespace | string | No | — | — |
condition_type | string | No | — | — |
condition_status | string | No | — | — |
timeout_seconds | integer | No | — | — |
poll_interval | integer | No | — | — |
matched | boolean | No | — | — |
poll_count | integer | No | — | — |
last_observed_status | json | 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 |
|---|---|---|---|---|---|
pending | Yes | No | — | start_polling | — |
waiting | No | No | — | — | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | start_polling | waiting | — |
waiting | poll | waiting | — |
waiting | complete | completed | — |
* (any state) | fail | failed | — |
API Usage ​
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "kubernetes.resource.wait_for_condition",
"initial_data": {
"connection_uuid": "value",
"api_version": "value",
"kind": "value",
"name": "value"
}
}