fix(Notion Node): Store lastTimeChecked as ISO string instead of moment object#28456
fix(Notion Node): Store lastTimeChecked as ISO string instead of moment object#28456okxint wants to merge 1 commit inton8n-io:masterfrom
Conversation
…nt object The NotionTrigger poll() method was storing a raw moment.js object into webhookData.lastTimeChecked. When TypeORM serializes staticData, it attempts to call native Date.prototype methods on the value, which fails because a moment object is not a native Date instance, throwing "TypeError: this is not a Date object." and preventing workflow activation. Calling .toISOString() ensures a plain string is persisted. The read-back path already wraps the value with moment(), so ISO strings are handled correctly. Fixes n8n-io#28445
|
|
|
Hey @okxint, Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request. Before we can proceed, please ensure the following: Regarding new nodes: If your node integrates with an AI service that you own or represent, please email nodes@n8n.io and we will be happy to discuss the best approach. About review timelines: Thank you again for contributing to n8n. |
Summary
The
NotionTriggernode'spoll()method stores a raw moment.js object intowebhookData.lastTimeChecked:webhookDatais backed by the workflow'sstaticData, which TypeORM serializes on every mutation. During serialization, TypeORM calls nativeDate.prototypemethods on the stored value. Since a moment.js object is not a nativeDateinstance, this throws:This error propagates up through
runPoll()→executeTrigger(true)→ActiveWorkflows.add(), where it gets wrapped as aWorkflowActivationError— preventing any workflow with a Notion Trigger from activating.The fix appends
.toISOString()so that a plain string is stored instead. The read-back path already wraps the value withmoment(), which parses ISO strings without issue, so no changes are needed there.Related Linear tickets, Github issues, and Community forum posts
Fixes #28445
https://linear.app/n8n/issue/GHC-7725
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)