Skip to main content

Goal

Track async jobs with predictable polling logic and clean terminal-state handling.

Polling Workflow

  1. Create a job with live-monitor or live-digest.
  2. Store returned job_id.
  3. Poll GET /jobs/{job_id} on an interval.
  4. Exit on terminal status: completed, stopped, or failed.

Reference Implementation (Python)

  • Start with 3-5 second intervals.
  • Add request timeout guards in your client.
  • Treat 404 JOB_NOT_FOUND as terminal for stale/expired job IDs.
  • Persist last known status for auditing.

When to Switch Away

Use webhooks or SSE when:
  • you need lower-latency push updates
  • many clients are polling the same stream
  • frontend UX needs live progress updates

Next Steps