Skip to content

Wait

Wait for time, file state, or HTTP readiness without wrapping polling loops in shell scripts.

Actions

ActionUse forRequired fields
wait.durationWait for a fixed durationduration
wait.untilWait until a timestampuntil
wait.filePoll for a file path to exist or disappearpath
wait.httpPoll an HTTP endpoint until it returns a statusurl

All duration fields use Go duration strings such as 500ms, 30s, 5m, or 1h.

Wait for a Duration

yaml
steps:
  - id: give_service_time
    action: wait.duration
    with:
      duration: 30s

Wait Until a Timestamp

until must be an RFC3339 timestamp. If the timestamp is already in the past, the step completes immediately.

yaml
steps:
  - id: maintenance_window
    action: wait.until
    with:
      until: "2030-01-02T03:04:05Z"  # Example future timestamp

Wait for a File

By default, wait.file waits for the path to exist. Use state: missing to wait until it disappears.

yaml
steps:
  - id: wait_for_ready_file
    action: wait.file
    with:
      path: ./ready.flag
      poll_interval: 2s
yaml
steps:
  - id: wait_for_lock_release
    action: wait.file
    with:
      path: ./deploy.lock
      state: missing
      poll_interval: 5s

Relative paths resolve from the step working directory.

Wait for HTTP Readiness

wait.http retries until the response status matches status. The default method is GET, and the default status is 200.

yaml
steps:
  - id: wait_for_api
    action: wait.http
    with:
      url: https://api.example.com/health
      status: 204
      poll_interval: 3s
      request_timeout: 10s

Headers and request bodies are supported:

yaml
steps:
  - id: wait_for_search
    action: wait.http
    with:
      method: POST
      url: https://api.example.com/search/ready
      status: 200
      headers:
        Authorization: "Bearer ${API_TOKEN}"
        Content-Type: application/json
      body: '{"index":"customers"}'

Network errors, connection refusals, and non-matching statuses are treated as “not ready” and retried until the step context is canceled or the DAG step times out.

Configuration

FieldTypeDefaultUsed byDescription
durationstringnonewait.durationFixed duration to wait.
untilstringnonewait.untilRFC3339 timestamp.
pathstringnonewait.fileFile or directory path.
statestringexistswait.fileexists or missing.
urlstringnonewait.httpAbsolute HTTP URL.
methodstringGETwait.httpHTTP method.
statusinteger200wait.httpExpected HTTP status code.
headersmapnonewait.httpHTTP request headers.
bodystringnonewait.httpHTTP request body.
poll_intervalstring1swait.file, wait.httpInterval between readiness checks.
request_timeoutstring10swait.httpPer-request timeout.

Use the step-level timeout_sec field to set an overall maximum wait time.

Released under the MIT License.