diff --git a/packages/@n8n/config/src/configs/executions.config.ts b/packages/@n8n/config/src/configs/executions.config.ts index 8c5d91b3c8..977d539920 100644 --- a/packages/@n8n/config/src/configs/executions.config.ts +++ b/packages/@n8n/config/src/configs/executions.config.ts @@ -6,7 +6,7 @@ class PruningIntervalsConfig { @Env('EXECUTIONS_DATA_PRUNE_HARD_DELETE_INTERVAL') hardDelete: number = 15; - /** How often (minutes) execution data should be soft-deleted */ + /** How often (minutes) execution data should be soft-deleted. */ @Env('EXECUTIONS_DATA_PRUNE_SOFT_DELETE_INTERVAL') softDelete: number = 60; } diff --git a/packages/cli/src/services/pruning/pruning.service.ts b/packages/cli/src/services/pruning/pruning.service.ts index a7bc56725d..aad8c5490f 100644 --- a/packages/cli/src/services/pruning/pruning.service.ts +++ b/packages/cli/src/services/pruning/pruning.service.ts @@ -13,9 +13,17 @@ import { Logger } from '@/logging/logger.service'; import { OrchestrationService } from '../orchestration.service'; /** - * Responsible for pruning executions from the database and their associated binary data - * from the filesystem, on a rolling basis. By default we soft-delete execution rows - * every cycle and hard-delete them and their binary data every 4th cycle. + * Responsible for deleting old executions from the database and deleting their + * associated binary data from the filesystem, on a rolling basis. + * + * By default: + * + * - Soft deletion (every 60m) identifies all prunable executions based on max + * age and/or max count, exempting annotated executions. + * - Hard deletion (every 15m) processes prunable executions in batches of 100, + * switching to 1s intervals until the total to prune is back down low enough, + * or in case the hard deletion fails. + * - Once mostly caught up, hard deletion goes back to the 15m schedule. */ @Service() export class PruningService {