Skip to content

fix(Notion Node): Store lastTimeChecked as ISO string instead of moment object#28456

Draft
okxint wants to merge 1 commit inton8n-io:masterfrom
okxint:fix/notion-trigger-static-data-serialization
Draft

fix(Notion Node): Store lastTimeChecked as ISO string instead of moment object#28456
okxint wants to merge 1 commit inton8n-io:masterfrom
okxint:fix/notion-trigger-static-data-serialization

Conversation

@okxint
Copy link
Copy Markdown

@okxint okxint commented Apr 14, 2026

Summary

The NotionTrigger node's poll() method stores a raw moment.js object into webhookData.lastTimeChecked:

webhookData.lastTimeChecked = moment().set({ second: 0, millisecond: 0 });

webhookData is backed by the workflow's staticData, which TypeORM serializes on every mutation. During serialization, TypeORM calls native Date.prototype methods on the stored value. Since a moment.js object is not a native Date instance, this throws:

TypeError: this is not a Date object.

This error propagates up through runPoll()executeTrigger(true)ActiveWorkflows.add(), where it gets wrapped as a WorkflowActivationError — 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 with moment(), 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

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)

…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
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@n8n-assistant n8n-assistant bot added community Authored by a community member node/improvement New feature or request in linear DEPRECATED labels Apr 14, 2026
@n8n-assistant
Copy link
Copy Markdown
Contributor

n8n-assistant bot commented Apr 14, 2026

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:
• Tests are included for any new functionality, logic changes or bug fixes.
• The PR aligns with our contribution guidelines.

Regarding new nodes:
We no longer accept new nodes directly into the core codebase. Instead, we encourage contributors to follow our Community Node Submission Guide to publish nodes independently.

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:
This PR has been added to our internal tracker as "GHC-7729". While we plan to review it, we are currently unable to provide an exact timeframe. Our goal is to begin reviews within a month, but this may change depending on team priorities. We will reach out when the review begins.

Thank you again for contributing to n8n.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Authored by a community member in linear DEPRECATED node/improvement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(nodes-base): NotionTrigger stores moment.js object in staticData, causing WorkflowActivationError on every activation

2 participants