kubernetes.job.wait_for_complete ​
Poll a Kubernetes Job until it reaches Complete or Failed condition (or timeout)
Poll a Kubernetes Job until it reaches a terminal condition (Complete or Failed) or until the configured timeout expires.
The workflow enters POLLING immediately after PENDING and re-schedules itself every poll_interval seconds. When a terminal condition is detected — or the elapsed wall-clock time exceeds timeout_seconds — it transitions to COMPLETED.
Condition detection rules (evaluated in order on each poll):
status.conditionscontains an entry withtype="Complete"andstatus="True"→succeeded=True.status.conditionscontains an entry withtype="Failed"andstatus="True"→succeeded=False(early exit, no timeout wait).- Neither terminal condition is present and elapsed time >=
timeout_seconds→succeeded=False(timeout). - Otherwise → reschedule and poll again.
Inputs:
- connection_uuid: UUID of the cloud connection (required)
- namespace: Namespace the Job lives in (required)
- name: Job name (required)
- timeout_seconds: Maximum wait time in seconds; default 600, cap 3600
- poll_interval: Seconds between polls; default 5, cap 60
Outputs:
- succeeded: bool — True if Complete; False if Failed or timeout
- poll_count: int — number of polls executed
- last_observed_status: JSON — raw status dict from the last read
- conditions: JSON — list of
Plugin required: context.get_plugin("connection").kubernetes_runner_clients(connection_uuid, organization_uuid) must expose batch_v1 with read_namespaced_job_status.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-kubernetes |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | Yes | — | — |
namespace | string | Yes | — | — |
name | string | Yes | — | — |
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 | — | — |
namespace | string | No | — | — |
name | string | No | — | — |
timeout_seconds | integer | No | — | — |
poll_interval | integer | No | — | — |
succeeded | boolean | No | — | — |
poll_count | integer | No | — | — |
last_observed_status | json | No | — | — |
conditions | json | No | — | — |
started_at | string | 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 | — |
polling | No | No | — | — | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | start_polling | polling | — |
polling | poll | polling | — |
polling | complete | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "kubernetes.job.wait_for_complete",
"initial_data": {
"connection_uuid": "value",
"namespace": "value",
"name": "value"
}
}