{"record":{"id":"e022cad497967e01","repo":"n8n-io/n8n","slug":"concurrency-limit-set-to-invalid-value","errorCode":null,"errorMessage":"Concurrency limit set to invalid value","messagePattern":"Concurrency limit set to invalid value","errorType":"exception","errorClass":"InvalidConcurrencyLimitError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/concurrency/concurrency-control.service.ts","lineNumber":101,"sourceCode":"\t\t\tthis.queues.set('evaluation', queue);\n\t\t\tthis.wireQueue(queue, 'evaluation');\n\t\t\tthis.evalQueueResolved = true;\n\t\t}\n\n\t\tthis.isEnabled = this.queues.size > 0;\n\n\t\tthis.limits.forEach((limit, type) => {\n\t\t\tif (type === 'evaluation' && !this.evalQueueResolved) return;\n\t\t\tthis.logger.debug(\n\t\t\t\t`${type === 'production' ? 'Production' : 'Evaluation'} execution concurrency is ${\n\t\t\t\t\tlimit === -1 ? 'unlimited' : 'limited to ' + limit.toString()\n\t\t\t\t}`,\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate normaliseLimit(limit: number): number {\n\t\tif (limit === 0) throw new InvalidConcurrencyLimitError(0);\n\t\treturn limit < -1 ? -1 : limit;\n\t}\n\n\t/**\n\t * Resolve the evaluation concurrency cap lazily on first use when the\n\t * constructor couldn't determine it from the env config alone. The\n\t * resolver follows env override → license-tier default; the license is\n\t * not guaranteed active at DI-construction time, so we defer until the\n\t * first eval execution hits `throttle`. Idempotent; subsequent calls\n\t * are a no-op.\n\t */\n\tprivate ensureEvalQueueResolved(): void {\n\t\tif (this.evalQueueResolved) return;\n\t\tthis.evalQueueResolved = true;\n\n\t\tif (this.globalConfig.executions.mode === 'queue') return;\n\n\t\tconst normalised = this.normaliseLimit(","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/cli/src/concurrency/concurrency-control.service.ts#L83-L119","documentation":"Thrown by `ConcurrencyControlService.normaliseLimit()` when a configured concurrency limit equals exactly `0`. The service treats `0` as an illegal value (it would block all executions), `-1` as unlimited, and any positive integer as a hard cap; values below `-1` are clamped to `-1`. It fires during DI construction (from `globalConfig.executions.concurrency.productionLimit`/`evaluationLimit`) or on lazy eval-queue resolution.","triggerScenarios":"Setting `N8N_CONCURRENCY_PRODUCTION_LIMIT=0` or `N8N_CONCURRENCY_EVALUATION_LIMIT=0`; passing 0 programmatically through GlobalConfig; a config layer defaulting to 0 due to a bad env parse.","commonSituations":"Operator misunderstands 0 as 'disabled' instead of 'blocked'; env var set to an empty string that parses to 0; migration from an older config schema that used 0 to mean unlimited.","solutions":["Set the limit to a positive integer (e.g. `N8N_CONCURRENCY_PRODUCTION_LIMIT=5`), or `-1` for unlimited.","Remove the env var entirely to fall back to the license-tier default.","Search deployment manifests and `.env` files for any `=0` concurrency setting."],"exampleFix":"# before\nN8N_CONCURRENCY_PRODUCTION_LIMIT=0\n# after\nN8N_CONCURRENCY_PRODUCTION_LIMIT=5","handlingStrategy":"validation","validationCode":"function validateLimit(name: string, v: number) {\n  if (v === 0) throw new Error(`${name} must be > 0 or -1 (unlimited); got 0`);\n  return v < -1 ? -1 : v;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use positive integers or -1 only; document that 0 is invalid.","Add a config sanity check in deployment scripts that scans for `=0` on concurrency env vars."],"tags":["concurrency","config","startup","user-error"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}