Skip to content
Proud to collaborate with Microsoft for Startups

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):

  1. status.conditions contains an entry with type="Complete" and status="True" → succeeded=True.
  2. status.conditions contains an entry with type="Failed" and status="True" → succeeded=False (early exit, no timeout wait).
  3. Neither terminal condition is present and elapsed time >= timeout_seconds → succeeded=False (timeout).
  4. 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 ​

PropertyValue
Workflow typeLinear
LibraryApp-kubernetes
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidYes——
namespacestringYes——
namestringYes——
timeout_secondsintegerNo——
poll_intervalintegerNo——
organization_uuiduuidNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo——
organization_uuiduuidNo——
namespacestringNo——
namestringNo——
timeout_secondsintegerNo——
poll_intervalintegerNo——
succeededbooleanNo——
poll_countintegerNo——
last_observed_statusjsonNo——
conditionsjsonNo——
started_atstringNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—start_polling—
pollingNoNo———
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingstart_pollingpolling—
pollingpollpolling—
pollingcompletecompleted—
* (any state)failfailed—

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"
  }
}