{"record":{"id":"efa923d8372b8511","repo":"n8n-io/n8n","slug":"invalid-date-format","errorCode":null,"errorMessage":"Invalid date format","messagePattern":"Invalid date format","errorType":"exception","errorClass":"UserError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/util.ts","lineNumber":52,"sourceCode":"\n\t\t\t\tif (limitOptions.resumeUnit === 'minutes') {\n\t\t\t\t\twaitAmount *= 60;\n\t\t\t\t}\n\t\t\t\tif (limitOptions.resumeUnit === 'hours') {\n\t\t\t\t\twaitAmount *= 60 * 60;\n\t\t\t\t}\n\t\t\t\tif (limitOptions.resumeUnit === 'days') {\n\t\t\t\t\twaitAmount *= 60 * 60 * 24;\n\t\t\t\t}\n\n\t\t\t\twaitAmount *= 1000;\n\t\t\t\twaitTill = new Date(new Date().getTime() + waitAmount);\n\t\t\t} else {\n\t\t\t\twaitTill = new Date(limitOptions.maxDateAndTime as string);\n\t\t\t}\n\n\t\t\tif (isNaN(waitTill.getTime())) {\n\t\t\t\tthrow new UserError('Invalid date format');\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow new NodeOperationError(context.getNode(), 'Could not configure Limit Wait Time', {\n\t\t\t\tdescription: error.message,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn waitTill;\n}\n\nexport const configureInputs = (parameters: { options?: { memoryConnection?: boolean } }) => {\n\tconst inputs = [\n\t\t{\n\t\t\ttype: 'main',\n\t\t},\n\t];\n\tif (parameters.options?.memoryConnection) {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/util.ts#L34-L70","documentation":"configureWaitTillDate throws a UserError('Invalid date format') when new Date(...) produced an Invalid Date — i.e. isNaN(waitTill.getTime()) is true. This happens for the 'maxDateAndTime' branch when the configured date/time string cannot be parsed by the JS Date constructor. Note: this UserError is immediately caught by the surrounding try/catch and rethrown as the NodeOperationError in error 767, so end users normally see 767's message with this as the description.","triggerScenarios":"limitOptions.limitType !== 'afterTimeInterval' and new Date(limitOptions.maxDateAndTime) yields Invalid Date (empty string, malformed locale, undefined, or a non-ISO string).","commonSituations":"The Limit Wait Time 'maxDateAndTime' field is blank or got corrupted; a workflow imported with a localized/non-ISO date string; the date-time picker value was not serialized correctly.","solutions":["Open the Chat Trigger's 'Limit Wait Time' option and set a valid date/time in the picker.","Prefer the 'afterTimeInterval' limit type (amount + unit) which does not depend on parsing a date string.","Ensure any expression feeding maxDateAndTime returns an ISO-8601 string."],"exampleFix":"// before: options.limitWaitTime.values.maxDateAndTime = ''\n// after:  options.limitWaitTime.values.maxDateAndTime = '2025-12-31T23:59:00.000Z'","handlingStrategy":"validation","validationCode":"// Validate the date string before constructing the Date.\nconst raw = limitOptions.maxDateAndTime;\nif (typeof raw === 'string' && raw.trim() !== '') {\n  const d = new Date(raw);\n  if (Number.isNaN(d.getTime())) throw new Error(`maxDateAndTime is not a parseable date: ${raw}`);\n}","typeGuard":"function isParsableDate(v: unknown): v is string {\n  return typeof v === 'string' && v.trim() !== '' && !Number.isNaN(new Date(v).getTime());\n}","tryCatchPattern":null,"preventionTips":["Prefer ISO-8601 date strings from a date-time picker over free text.","When limitType is a fixed date, validate the value in the UI before save."],"tags":["validation","date","configuration","chat-trigger","wait-time"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}