Policies
Policies control how long a job runs and when it stops automatically.
{ "policies": { "maxDurationSec": 7200, "idleTimeoutSec": 60 }}| Field | Type | Default | Description |
|---|---|---|---|
maxDurationSec | int | 0 (unlimited) | Maximum job duration in seconds. 0 disables the cap. When reached, the job completes. Clamped to max 86400 (24h). |
idleTimeoutSec | int | 60 | Seconds without media activity before the job ends. Activity comes from components_metrics (videoMillis / audioMillis / videoFrames / audioFrames). Set 0 to disable. Clamped to max 3600. |
Idle detection
Section titled “Idle detection”Idle is evaluated every ~10s with this priority:
- Source idle — if the job has sources and none have reported activity within
idleTimeoutSec, the job ends with eventjob.idle_timeoutand reasonsource(Prometheus labelsource_idle). - Sink idle — otherwise, if the job has sinks and none have reported activity within the threshold, it ends with the same event and reason
sink(Prometheus labelsink_idle). - Jobs with no sinks only check sources.
If a role never saw activity, the grace baseline is the job’s updatedAt / createdAt (not wall-clock zero). Job status is completed, same as other policy stops.
- RTC sources (
livekit,jitsi,daily,agora): idle when room media matching yourselectfilters stops producing metrics. - Pull sources (
rtmp_pull,hls_pull, etc.): idle when the stream stalls or disconnects (no further metrics activity).
Idle periods are not billed for media processing. See Billing overview.
Stopping jobs
Section titled “Stopping jobs”Jobs also stop when you call DELETE /v1/jobs/:name or when the platform container reaches its maximum lifetime.