Cost Models // FlowLedger Research
PostgreSQL 16 flow_run Execution Log Bloat & Pruning Model
Unpruned JSON step payloads grow PostgreSQL 16 TOAST tables by ~65 MB per 1,000 multi-step runs; setting 14-30 day retention prevents disk saturation.
Measured Unit Economics & Telemetry
Activepieces persists full step inputs, outputs, and error traces inside PostgreSQL 16 JSON/bytea columns. At 500,000 monthly runs with 8 steps each, keeping 180 days of logs consumes 150-200 GB of NVMe including B-tree indexes and dead tuples. Setting AP_EXECUTION_DATA_RETENTION_DAYS=30 alongside autovacuum_vacuum_scale_factor=0.05 holds storage under 35 GB.
| Resource / Billing Line | Audited Value | FinOps Impact |
|---|---|---|
| 100k Runs @ 14-Day Retention | ~3.8 GB NVMe | Safe even on compact 50 GB volumes |
| 200k Runs @ 30-Day Retention | ~12.6 GB NVMe | Fits Hostinger KVM 2 (100 GB) easily |
| 500k Runs @ 90-Day Retention | ~64.2 GB NVMe | Fits Hostinger KVM 4 (200 GB NVMe) |
| Autovacuum Scale Factor | 0.05 (vs 0.20 default) | Reclaims deleted flow_run TOAST pages daily |
Implementation & Configuration Checklist
- Cap AP_EXECUTION_DATA_RETENTION_DAYS: Set 14 days for high-volume webhook/AI pipelines or 30 days for standard agency billing audits.
- Tune Postgres Autovacuum to 0.05: Pass -c autovacuum_vacuum_scale_factor=0.05 so deleted step blobs return pages immediately.
- Monitor pg_total_relation_size: Audit flow_run and step_file table sizes monthly before resizing NVMe tiers.
AP_EXECUTION_DATA_RETENTION_DAYS=30
postgres -c shared_buffers=1024MB -c work_mem=16MB -c autovacuum_vacuum_scale_factor=0.05
Workflow Infrastructure FAQ
Does deleting old flow_run logs break active flows or connections?
No. Only historical run input/output inspection logs expire; flow definitions and OAuth credentials stay intact.
Why does disk space stay high even after setting retention to 14 days?
Default Postgres autovacuum waits for 20% dead tuples; lowering scale factor to 0.05 triggers timely space reuse.