Operations
Retention
Configure scheduled cleanup of terminal runs with runs.retention, choose between pruning logs and deleting run records.
Retention
Envoy retention applies to terminal task runs and their captured logs. Set it deliberately: run metadata, logs, metrics, source data, exports, and backups have different lifecycles.
Configuration
The three keys under runs.retention in envoy-server.yaml, with their defaults:
runs:
retention:
max_age_days: 30
delete_runs: false
cleanup_cron: "0 3 * * *"max_age_days— terminal runs older than this are eligible for cleanup. Set0or less to disable scheduled cleanup.delete_runs: false— remove captured logs but keep the run record.delete_runs: true— also remove eligible run records and their metrics.cleanup_cron— when the control-plane cleanup executes.
Cleanup considers terminal statuses — successful, failed, completed, and cancelled runs. It does not prune active work.
Keep metadata, prune logs
The conservative policy is delete_runs: false. The run remains available for audit and operational history while its log content is removed from the log store. Use this when the fact and outcome of execution must outlive record-level diagnostics.
Delete run history
With delete_runs: true, cleanup deletes run log data, removes run metrics, and deletes each run record. Cleanup is best effort across supporting stores — monitor server logs for failures, especially after changing database permissions or log backends. Deleting child run records reduces the detail available on older Job Runs.
Manual cleanup
Admins and superadmins can clear logs or delete eligible runs from the UI, including bulk delete on run lists. Clearing logs and deleting runs are distinct actions: clear logs when metadata should remain; delete only when policy permits removing the record and metrics. Stopping an active run does not delete it.
Log stores
Per-run logs can use file, db, mssql, postgres, or victoria_logs storage (runs.log_store). Retention calls the configured log store's delete path, so the service identity needs delete permission on that store. For VictoriaLogs specifically, deletion must be enabled on the backend — see VictoriaLogs.
Container stdout is process output governed by the container platform's logging policy, not Envoy run retention.
Related retention domains
Manage separately: metrics backend pruning, dashboard and Data Explorer exports, connector source and destination records, uploaded files, state-database backups and Litestream replicas, and AI conversation history. Deleting an Envoy run does not remove data written to an external destination.
Policy checklist
- Determine the audit period for run metadata.
- Determine the (possibly shorter) period for record-bearing logs.
- Configure the log backend and its access controls.
- Set
delete_runsto match the policy. - Align backup expiration; otherwise deleted data remains in snapshots.
- Test cleanup against non-production terminal runs.
- Alert on cleanup failures and unexpected storage growth.
Related
- Server configuration —
runs.retentionamong the full schema - VictoriaLogs — deletion semantics on the external log backend
- Backups and upgrades — snapshot lifecycles versus retention