Error 400 creating database page in Notion

When I try to create a database page in Notion, it displays the ERROR: Request failed with status code 400

I’m using n8n locally with the npx command

This is my workflow

{
  "name": "My workflow",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "sheetId": "1QBr02z4CmLS-V4IrDzCvPEXfxZz3lSmoP36uCyj2Sr8",
        "options": {}
      },
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        450,
        300
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "6",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "resource": "databasePage",
        "databaseId": "56fbb0a5-dd0a-42af-ac4a-d2cbdb8fc34c",
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Name|title",
              "title": "={{$json[\"Nome\"]}}"
            },
            {
              "key": "Email|rich_text",
              "textContent": "={{$json[\"Email\"]}}"
            },
            {
              "key": "Telefone|rich_text",
              "textContent": "={{$json[\"Telefone\"]}}"
            },
            {
              "key": "Mensagem|rich_text",
              "textContent": "={{$json[\"Mensagem\"]}}"
            }
          ]
        },
        "blockUi": {
          "blockValues": []
        }
      },
      "name": "Notion",
      "type": "n8n-nodes-base.notion",
      "typeVersion": 1,
      "position": [
        850,
        200
      ],
      "credentials": {
        "notionApi": {
          "id": "14",
          "name": "Notion account"
        }
      }
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "Sincronizado",
              "value": "=Sim"
            },
            {
              "name": "Carimbo de data/hora",
              "value": "={{$node[\"IF\"].json[\"Carimbo de data/hora\"]}}"
            }
          ]
        },
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1050,
        200
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "="
            }
          ]
        }
      },
      "name": "IF",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {},
      "name": "NoOp",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        850,
        400
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "update",
        "sheetId": "1QBr02z4CmLS-V4IrDzCvPEXfxZz3lSmoP36uCyj2Sr8",
        "key": "Carimbo de data/hora",
        "options": {
          "valueInputMode": "USER_ENTERED"
        }
      },
      "name": "Google Sheets1",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        1250,
        200
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "6",
          "name": "Google Sheets account"
        }
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "IF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF": {
      "main": [
        [
          {
            "node": "Notion",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "NoOp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets1": {
      "main": [
        []
      ]
    }
  },
  "active": false,
  "settings": {},
  "id": 20
}```

Hey @Claudio_Balbino,

What version of n8n are you running? It could be related to the change of the request library over to Axios.

Hey @Claudio_Balbino,

I got the same error with one of my workflows. On further inspection, I learned that one of the fields contain empty that resulted in the error. Is any of the fields empty in the Notion node?

Hi @Jon

I’m using version 0.146.0

Hi @harshil1712

I verified that the four fields I got in my spreadsheet are referenced as you can see in the images and I didn’t see empty spaces

sheets send me five pieces of information, I get four and my database no notion has eight fields


Hi @Jon and @harshil1712

Curious that after my last message I managed to send two out of three records to the notion, but it had the same error in the node, and then it didn’t send any more

I noticed that this workflow is not recording the executions

Hi @Jon and @harshil1712

It includes a few more records in the spreadsheet, it only sends the first two and it has the same error

That is odd, I would need to set up a small test to see if I can reproduce it.

@Jon

if you prefer, I can share the worksheet and the notion page with you

Hi @Jon

Did you manage to reproduce the error? I created this workflow the n8n installed on a friend’s vps and it worked… the problem is in the local use

Hey @Claudio_Balbino,

To be honest I have not yet had a chance to set up a notion database page to give it a bash it is on my list for this afternoon.

It sounds like you may be onto the solution though, Is there anything different between your setup and the VPS setup?

Can you share the spreadsheet with me?

I didn’t find the solution, I just checked that the vps is ok, but I use it locally

@RicardoE105

of course, follow link to copy of spreadsheet

thanks

if you need i can share the notion page too

Looks like due to formatting issues the first two records come as strings while the rest come as numbers. Can you try again setting the parameter Value Render Mode to Formatted Value?

image

1 Like

@RicardoE105

Perfect! Thank you very much, it is now working. :clap::rocket:

1 Like