Cost Models // FlowLedger Research
AP_EXECUTION_MODE: UNSANDBOXED vs SANDBOX_CODE_ONLY vs SANDBOXED RAM
Switching AP_EXECUTION_MODE from UNSANDBOXED to SANDBOXED adds ~230 MB per concurrent worker; SANDBOX_CODE_ONLY cuts that penalty in half.
Measured Unit Economics & Telemetry
Activepieces controls runtime isolation via AP_EXECUTION_MODE. UNSANDBOXED runs all steps in the shared Node.js worker (~32 MB/slot), risking prototype pollution if untrusted users write code steps. SANDBOX_CODE_ONLY isolates custom TypeScript in V8 isolated-vm (~128 MB/slot), whereas full SANDBOXED isolates every piece (~265 MB/slot) and requires KVM 4 (16 GB) at higher concurrency.
| Resource / Billing Line | Audited Value | FinOps Impact |
|---|---|---|
| UNSANDBOXED (8 Workers) | ~420 MB worker pool | Lowest RAM; internal trusted authors only |
| SANDBOX_CODE_ONLY (8 Workers) | ~1.20 GB worker pool | V8 isolate for Code pieces; fits KVM 2 (8 GB) |
| SANDBOXED Full (8 Workers) | ~2.30 GB worker pool | Full step isolation; KVM 4 (16 GB) safer |
| SANDBOXED Full (16 Workers) | ~4.42 GB worker pool | Requires KVM 4 (16 GB) or KVM 8 (32 GB) |
Implementation & Configuration Checklist
- Default Production to SANDBOX_CODE_ONLY: Protect Node.js worker memory from arbitrary user JavaScript while keeping official pieces fast.
- Match Concurrency to Physical RAM: Verify (AP_FLOW_WORKER_CONCURRENCY * perWorkerMb) + Postgres + Redis stays below 80% of KVM RAM.
- Switch to Full SANDBOXED for Multi-Tenant: When non-staff users author custom connectors or npm imports, allocate KVM 4 (16 GB) and enable full SANDBOXED.
AP_EXECUTION_MODE=SANDBOX_CODE_ONLY
AP_FLOW_WORKER_CONCURRENCY=8
AP_SANDBOX_MEMORY_LIMIT=131072
Workflow Infrastructure FAQ
Does SANDBOX_CODE_ONLY slow down standard HTTP or Slack pieces?
No. Standard built-in pieces execute directly in the worker while only Code pieces enter the V8 sandbox.
Can an 8 GB Hostinger KVM 2 run full SANDBOXED mode?
Yes up to ~8-10 concurrent workers with Playwright disabled and Postgres retention capped at 30 days.