Hi everyone,
I’m building a workflow to automate blog creation and I’ve hit a persistent roadblock with the Notion API. I’m hoping someone can point me in the right direction.
My Goal:
The workflow is triggered by a Telegram message, uses OpenAI to generate a blog post (text), and then should create a single new page in a Notion database with the text as paragraph blocks.
The Core Problem:
When the workflow runs, the Notion node fails with the following error:
"Body is not valid. body.parent should be an object, instead was undefined. This version of the API does not support this type of block type. Please upgrade your API version."
This clearly indicates that my request is missing the Notion-Version: 2022-06-28 header. The problem is, I can’t figure out how to add it.
What I Have Tried: (With the help of Gemini)
We’ve attempted two main solutions, but both have failed:
Attempt 1: Using the standard Notion Node
- My first approach was to use the dedicated
Notionnode. - To fix the API version error, the suggested solution was to add a “Header” field in the node’s Options section.
- The Roadblock: My n8n interface for the Notion node does not have an “Add field” or “Add Option” button inside the Options section. It seems to be missing entirely, so I have no way to add the
Notion-Versionheader.
Attempt 2: Using the HTTP Request Node
- As a workaround, we tried bypassing the Notion node and using the generic
HTTP Requestnode to have full manual control. - We configured the node with
POSTtohttps://api.notion.com/v1/pages, added theAuthorizationandNotion-Versionheaders correctly. - The Roadblock: We are struggling to correctly format the JSON body with the expressions needed to pull in the data from previous steps (specifically, the array of paragraph blocks for the
childrenproperty). This method feels overly complex and is also resulting in errors.
My Question for the Community:
Given that my Notion node seems to be missing the ability to add a header, what is the recommended way to solve this API version error?
- Is there another way to force the
Notionnode to use the2022-06-28version that I’m not aware of? - If I must use the
HTTP Requestnode, what is the correct syntax for the JSON Body expression to pass an array of block objects from a previous Code node to thechildrenproperty?
Any help would be greatly appreciated. I feel like I’m one small step away from getting this to work!
Thank you!