---
name: flaky-check-retry-budget
description: Poll a condition that is slow to settle, and give up on a schedule instead of waiting indefinitely.
runbook:
  schema_version: v1
  semver: 1.0.0
  profile: P1
  min_runtime_profile: R1
  domain: incident-response
  targets:
    - linux
  trigger: symptom
  execution: agent-autonomous
  risk: read-only
  blast_radius: resource
  duration: <5m
  capabilities:
    - cli:test
  publisher: std
  lang: en
  license: CC-BY-4.0
  steps:
    - id: s1
      kind: check
      title: Check whether the marker exists
      tool: cli:test
      command: test -f /tmp/runbooks-marker
      expect: the marker file exists
      assert:
        exit_code: 0
      on_fail: s2
      next: end:success
    - id: s2
      kind: wait
      title: Wait and check again
      duration: 2s
      retry:
        max: 2
        target: s1
      next: end:failed
  source:
    url: https://runbooks.directory/r/std/flaky-check-retry-budget/source.md
    fetched_at: 2026-09-02
    upstream_state: current
---

## When to reach for this

A condition is slow to settle and you want to give up on a schedule rather than wait
indefinitely.

## Notes

The retry budget is what makes this safe to hand an autonomous agent: without a finite
limit, a condition that never settles becomes a loop that costs money until someone
notices.
