Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valid Notion page IDs are rejected #10831

Open
nihaals opened this issue Sep 16, 2024 · 3 comments
Open

Valid Notion page IDs are rejected #10831

nihaals opened this issue Sep 16, 2024 · 3 comments
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@nihaals
Copy link
Contributor

nihaals commented Sep 16, 2024

Bug Description

Notion documents page IDs as being UUIDv4, however I have some page IDs that don’t have a 4 in the correct position. This means some Notion nodes reject the input even though the ID came directly from a Notion API response.

n8n’s regexes that neither the ID or the URL from the API response match:

{
displayName: 'Link',
name: 'url',
type: 'string',
placeholder: 'https://www.notion.so/My-Page-b4eeb113e118403aa450af65ac25f0b9',
validation: [
{
type: 'regex',
properties: {
regex:
'(?:https|http):https://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{1,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
errorMessage: 'Not a valid Notion Database Page URL',
},
},
],
extractValue: {
type: 'regex',
regex:
'(?:https|http):https://www.notion.so/(?:[a-z0-9-]{2,}/)?(?:[a-zA-Z0-9-]{1,}-)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: 'ab1545b247fb49fa92d6f4b49f4d8116',
validation: [
{
type: 'regex',
properties: {
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
errorMessage: 'Not a valid Notion Page ID',
},
},
],
extractValue: {
type: 'regex',
regex: '^([0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12})',
},
url: '=https://www.notion.so/{{$value.replace(/-/g, "")}}',
},

To Reproduce

  1. Keep creating Notion pages until/find an existing page that doesn’t have a 4 in the expected position
  2. Pass it into a page action node, for example archive page as an ID
  3. Notice you get an error: “Page parameter's value is invalid. This is likely because the URL entered is incorrect [item 0]”

Expected behavior

The page is archived.

Operating System

Docker n8n:1.56.2

n8n Version

1.56.2

Node.js Version

Docker

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Sep 16, 2024

Hey @nihaals,

We have created an internal ticket to look into this which we will be tracking as "GHC-235"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Sep 16, 2024
@Joffcom
Copy link
Member

Joffcom commented Sep 16, 2024

Hey @nihaals,

Can you share some URLs that show the errors? Notion page urls should be UUID 4 looking at their documentation.

@nihaals
Copy link
Contributor Author

nihaals commented Sep 16, 2024

I think this might have changed within the past couple of weeks as the first page I just made wasn't a UUIDv4: https://www.notion.so/10336a9a827580b895e3f7ff1d3ea585 (the page is public).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

2 participants