From c5729772ffb4d0267c21ceee2911588d4c3c6c02 Mon Sep 17 00:00:00 2001 From: Justin Ellingwood Date: Fri, 20 Dec 2024 16:56:08 +0000 Subject: [PATCH] Add common issues to Notion node --- .../n8n-nodes-base.notion/common-issues.md | 74 +++++++++++++++++++ .../index.md} | 3 + mkdocs.yml | 4 +- 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 docs/integrations/builtin/app-nodes/n8n-nodes-base.notion/common-issues.md rename docs/integrations/builtin/app-nodes/{n8n-nodes-base.notion.md => n8n-nodes-base.notion/index.md} (89%) diff --git a/docs/integrations/builtin/app-nodes/n8n-nodes-base.notion/common-issues.md b/docs/integrations/builtin/app-nodes/n8n-nodes-base.notion/common-issues.md new file mode 100644 index 00000000000..81eb6b5dee6 --- /dev/null +++ b/docs/integrations/builtin/app-nodes/n8n-nodes-base.notion/common-issues.md @@ -0,0 +1,74 @@ +--- +#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4 +title: Notion node common issues +description: Documentation for common issues and questions in the Notion node in n8n, a workflow automation platform. Includes details of the issue and suggested solutions. +contentType: integration +priority: high +--- + +# Notion node common issues + +Here are some common errors and issues with the [Notion node](/integrations/builtin/app-nodes/n8n-nodes-base.notion/) and steps to resolve or troubleshoot them. + +## Relation property not displaying + +The Notion node only supports displaying the data relation property for [two-way relations](https://www.notion.com/help/relations-and-rollups). When you connect two Notion databases with a two-way relationship, you can select or filter by the relation property when working with the Notion node's **Database Page** resource. + +To enable two-way relations, edit the relation property in Notion and enable the **Show on [name of related database]** option to create a reverse relation. Select a name to use for the relation in the new context. The relation is now accessible in n8n when filtering or selecting. + +If you need to work with Notion databases with one-way relationship, you can use the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) with your existing Notion credentials. For example, to update a one-way relationship, you can send a `PATCH` request to the following URL: + +``` +https://api.notion.com/v1/pages/ +``` + +Enable **Send Body**, set the **Body Content Type** to **JSON**, and set **Specify Body** to **Using JSON**. Afterward, you can enter a JSON object like the following into the **JSON** field: + +```json +{ + "properties": { + "Account": { + "relation": [ + { + "id": "" + } + ] + } + } +} +``` + +## Create toggle heading + +The Notion node allows you to create headings and toggles when adding blocks to **Page**, **Database Page**, or **Block** resources. Creating toggleable headings isn't yet supported by the Notion node itself. + +You can work around this be creating a regular heading and then modifying it to enable the [`is_toggleable` property](https://developers.notion.com/reference/block#headings): + +1. Add a heading with Notion node. +2. Select the resource you want to add a heading to: + * To add a new page with a heading, select the **Page** or **Database Page** resources with the **Create** operation. + * To add a heading to an existing page, select the **Block** resource with the **Append After** operation. +3. Select **Add Block** and set the **Type Name or ID** to either **Heading 1**, **Heading 2**, or **Heading 3**. +4. Add an [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) node connected to the Notion node and select the `GET` method. +5. Set the **URL** to `https://api.notion.com/v1/blocks/`. For example, if your added the heading to an existing page, you could use the following URL: `https://api.notion.com/v1/blocks/{{ $json.results[0].id }}`. If you created a new page instead of appending a block, you may need to discover the block ID by querying the page contents first. +6. Select **Predefined Credential Type** and connect your existing Notion credentials. +7. Add an [Edit Fields (Set)](/integrations/builtin/core-nodes/n8n-nodes-base.set/) node after the HTTP Request node. +8. Add `heading_1.is_toggleable` as a new **Boolean** field set to `true`. Swap `heading_1` for a different heading number as necessary. +9. Add a second HTTP Request node after the Edit Fields (Set) node. +10. Set the **Method** to `PATCH` and use `https://api.notion.com/v1/blocks/{{ $json.id }}` as the **URL** value. +11. Select **Predefined Credential Type** and connect your existing Notion credentials. +12. Enable **Send Body** and set a parameter. +13. Set the parameter **Name** to `heading_1` (substitute `heading_1` for the heading level you are using). +14. Set the parameter **Value** to `{{ $json.heading_1 }}` (substitute `heading_1` for the heading level you are using). + +The above sequence will create a regular heading block. It will query the newly created header, add the `is_toggleable` property, and update the heading block. + +## Handle null and empty values + +You may receive a validation error when working with the Notion node if you submit fields with empty or null values. This can occur any time you populate fields from previous nodes when that data is missing. + +To work around this, check for the existence of the field data before sending it to Notion or use a default value. + +To check for the data before executing the Notion node, use an [If](/integrations/builtin/core-nodes/n8n-nodes-base.if/) node to check whether the field is unset. This allows you to use the [Edit Fields (Set)](/integrations/builtin/core-nodes/n8n-nodes-base.set/) node to conditionally remove the field when it doesn't have a valid value. + +As an alternative, you can set a [default value](/code/cookbook/expressions/check-incoming-data/) if the incoming data doesn't provide one. diff --git a/docs/integrations/builtin/app-nodes/n8n-nodes-base.notion.md b/docs/integrations/builtin/app-nodes/n8n-nodes-base.notion/index.md similarity index 89% rename from docs/integrations/builtin/app-nodes/n8n-nodes-base.notion.md rename to docs/integrations/builtin/app-nodes/n8n-nodes-base.notion/index.md index e2c7231b24f..048a84a4797 100644 --- a/docs/integrations/builtin/app-nodes/n8n-nodes-base.notion.md +++ b/docs/integrations/builtin/app-nodes/n8n-nodes-base.notion/index.md @@ -51,3 +51,6 @@ Refer to [Notion's documentation](https://developers.notion.com/){:target=_blank --8<-- "_snippets/integrations/builtin/app-nodes/operation-not-supported.md" +## Common issues + +For common errors or issues and suggested resolution steps, refer to [Common issues](/integrations/builtin/app-nodes/n8n-nodes-base.notion/common-issues/). diff --git a/mkdocs.yml b/mkdocs.yml index 875d42e7cc1..22db1d335c4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -623,7 +623,9 @@ nav: - Netscaler ADC: integrations/builtin/app-nodes/n8n-nodes-base.netscaleradc.md - Nextcloud: integrations/builtin/app-nodes/n8n-nodes-base.nextcloud.md - NocoDB: integrations/builtin/app-nodes/n8n-nodes-base.nocodb.md - - Notion: integrations/builtin/app-nodes/n8n-nodes-base.notion.md + - Notion: + - Notion: integrations/builtin/app-nodes/n8n-nodes-base.notion/index.md + - Common issues: integrations/builtin/app-nodes/n8n-nodes-base.notion/common-issues.md - npm: integrations/builtin/app-nodes/n8n-nodes-base.npm.md - Odoo: integrations/builtin/app-nodes/n8n-nodes-base.odoo.md - Okta: integrations/builtin/app-nodes/n8n-nodes-base.okta.md