n8n-io/n8n · warning
INVALID_DATE_METHOD
INVALID_DATE_METHOD
Error message
'${node.name}' parameter "${path}" uses .toISOString() which is a JS Date method. Use .toISO() for Luxon DateTime ($now, $today). What it means
Warning-level validator issue (code INVALID_DATE_METHOD) emitted when a parameter value string contains '.toISOString()', which is a JavaScript Date method. n8n's $now and $today are Luxon DateTime objects, whose equivalent method is .toISO(). Using the JS method will fail at evaluation time, so the validator flags it preemptively.
Source
Thrown at packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/date-method-validator.ts:38
priority: 30,
validateNode(
node: NodeInstance<string, string, unknown>,
_graphNode: GraphNode,
_ctx: PluginContext,
): ValidationIssue[] {
const issues: ValidationIssue[] = [];
const params = node.config?.parameters;
if (!params) {
return issues;
}
const dateIssues = findInvalidDateMethods(params);
for (const { path } of dateIssues) {
issues.push({
code: 'INVALID_DATE_METHOD',
message: `'${node.name}' parameter "${path}" uses .toISOString() which is a JS Date method. Use .toISO() for Luxon DateTime ($now, $today).`,
severity: 'warning',
nodeName: node.name,
parameterPath: path,
});
}
return issues;
},
};
View on GitHub (pinned to 5ac6606e81)
Solutions
- Replace .toISOString() with .toISO() for any Luxon DateTime ($now, $today).
- Verify the result format matches expectations (ISO string).
- Re-run validation to confirm the issue clears.
Example fix
// before
'={{ $now.toISOString() }}'
// after
'={{ $now.toISO() }}' Defensive patterns
Strategy: validation
Validate before calling
/\.toISOString\(\)/.test(String(paramValue)) // warn: Luxon DateTime ($now/$today) should use .toISO()
Prevention
- Remember $now and $today are Luxon DateTime, not JS Date.
- Use .toISO() for ISO strings, .toMillis() for epoch, .plus()/.minus() for arithmetic.
- Search expressions for '.toISOString' before exporting.
When it happens
Trigger: Writing an expression like '={{ $now.toISOString() }}' or '={{ $today.toISOString() }}' in any node parameter.
Common situations: Copying JS Date code into an expression; LLM-generated workflow that assumes native Date; muscle memory from non-Luxon environments.
Related errors
- isBetween(): expected exactly two args
- Unsupported unit '${String(errorUnit)}'. Supported: ${durati
- Unsupported format '${String(valueFormat)}'. toDateTime() su
- Value is not a valid date
- cannot convert to date
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/9090dc1ab23b288b.
Report an issue: GitHub.