feat: Enforce data-stores limits (no-changelog) (#19116)

Co-authored-by: Charlie Kolb <charlie@n8n.io>
This commit is contained in:
Ricardo Espinoza
2025-09-10 09:39:41 -04:00
committed by GitHub
parent 815ecfe680
commit eb389a787b
17 changed files with 559 additions and 27 deletions

View File

@@ -0,0 +1,22 @@
import { Config, Env } from '../decorators';
@Config
export class DataTableConfig {
/** Specifies the maximum allowed size (in bytes) for data tables. */
@Env('N8N_DATA_TABLES_MAX_SIZE_BYTES')
maxSize: number = 100 * 1024 * 1024;
/**
* The percentage threshold at which a warning is triggered for data tables.
* When the usage of a data table reaches or exceeds this value, a warning is issued.
*/
@Env('N8N_DATA_TABLES_WARNING_THRESHOLD_BYTES')
warningThreshold: number = 95 * 1024 * 1024;
/**
* The duration in milliseconds for which the data table size is cached.
* This prevents excessive database queries for size validation.
*/
@Env('N8N_DATA_TABLES_SIZE_CHECK_CACHE_DURATION_MS')
sizeCheckCacheDuration: number = 5 * 1000;
}