{"record":{"id":"ec9ed479cddd652e","repo":"n8n-io/n8n","slug":"invalid-timezone-timezone","errorCode":null,"errorMessage":"Invalid timezone: \"${timezone}\"","messagePattern":"Invalid timezone: \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/expression-runtime/src/runtime/context.ts","lineNumber":112,"sourceCode":" * Build a fresh, closure-scoped evaluation context.\n *\n * This function creates a context object that contains everything needed to\n * evaluate an expression, without touching any global mutable state\n * (except luxon's Settings.defaultZone which is process-wide).\n *\n * The returned object is used as tournament's `this` context in the\n * evalClosureSync wrapper.\n *\n * @param callbacks - Bridge callbacks (data-access primitives + typed RPCs)\n * @param timezone - Optional IANA timezone string\n * @returns A context object with all workflow data, proxies, and builtins\n */\nexport function buildContext(\n\tcallbacks: BridgeCallbacks,\n\ttimezone?: string,\n): Record<string, unknown> {\n\tif (timezone && !IANAZone.isValidZone(timezone)) {\n\t\tthrow new Error(`Invalid timezone: \"${timezone}\"`);\n\t}\n\tSettings.defaultZone = timezone ?? 'system';\n\n\tconst target: Record<string, unknown> = {};\n\n\t// __sanitize must be on the context because PrototypeSanitizer generates:\n\t// obj[this.__sanitize(expr)] where 'this' is the context (via .call(ctx) wrapping)\n\t// Use a non-writable property descriptor so override attempts throw instead of silently succeeding.\n\tObject.defineProperty(target, '__sanitize', {\n\t\tget: () => __sanitize,\n\t\tset: () => {\n\t\t\tthrow new ExpressionError('Cannot override \"__sanitize\" due to security concerns');\n\t\t},\n\t\tenumerable: false,\n\t\tconfigurable: false,\n\t});\n\n\t// -------------------------------------------------------------------------","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/expression-runtime/src/runtime/context.ts#L94-L130","documentation":"Error \"Invalid timezone: \"${timezone}\"\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/expression-runtime/src/runtime/context.ts:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}