Notion node gains OAuth2 authentication support

The Notion node in n8n now supports two authentication methods: the existing API Key option and a new OAuth2 flow for users who need token refresh and scoped access.
The Notion node previously only supported API Key authentication, which works for many use cases but lacks the token refresh capabilities and granular permissions that OAuth2 provides. This PR adds OAuth2 as a second authentication option, letting users choose the method that fits their security requirements.
Users who prefer OAuth2 can now connect their Notion integration using that flow, which is particularly valuable for long-running workflows where token expiration could otherwise interrupt operations. The implementation dynamically selects the credential type based on the chosen authentication method — API Key users continue using notionApi credentials while OAuth2 users get notionOAuth2Api credentials.
This change touches the core Notion node in the n8n nodes-base package, with modifications across the trigger node, the versioned operation node, and the shared authentication logic. The OAuth2 support was already partially prepared in the codebase — the options were commented out — and this PR activates that infrastructure.
View Original GitHub Description
Summary
Adds support for OAuth to the Notion node
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/NODE-4660
Review / Merge checklist
- PR title and summary are descriptive. (conventions) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** -->
- Docs updated or follow-up ticket created.
- Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. -->
- PR Labeled with
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)