Setting API version for Notion requests in n8n workflows or properly formatting child elements

I’m working on an n8n automation that connects OpenAI with Notion to create pages. The setup involves breaking down AI-generated text into separate paragraph blocks stored as an array.

The main issue is getting a block type error from Notion that says the current API version doesn’t support my block format. It needs the header Notion-Version: 2022-06-28 to work properly.

First approach - Direct Notion connector:
I tried adding custom headers through the node settings but can’t find any option to add extra fields or headers in my n8n version.

Second approach - Generic HTTP connector:
Switched to making raw HTTP calls where I can control headers like Authorization and Notion-Version. This works for authentication but I’m stuck on the request body formatting. I can’t figure out how to properly insert my paragraph block array into the children field of the JSON payload.

What I need help with:

  1. Any way to make the standard Notion connector use a different API version when the UI doesn’t show header options?
  2. If using HTTP requests is the only option, how do I write the expression syntax to map my block array from the previous step into the children property of the request body?

Thanks for any guidance on this!

Had the same issue with n8n and Notion’s API. The version mismatch happens because n8n’s Notion node can’t keep up with API updates. For the HTTP method, try {{ $json["your_array_field_name"] }} in the children field. Your paragraph blocks need to be formatted as proper Notion block objects first though. What tripped me up was the request body structure - Notion’s picky about it. If you’re getting formatting errors, log the actual JSON to check if your block array sits correctly inside the children property. Stick with HTTP. More work upfront but you’ll avoid headaches when you need newer API features the standard connector doesn’t support yet.

Go with HTTP since the native Notion node uses an outdated API version. For mapping the children array, make sure your block objects are structured correctly before inserting them. Use {{ $('NodeName').all()[0].json.blockArray }} where NodeName is your previous step and blockArray is your paragraph collection. Your request body should be {"parent": {"page_id": "your-page-id"}, "children": {{ $('NodeName').all()[0].json.blockArray }}}. Check that each paragraph block has the type and paragraph properties with proper text formatting. I throw in a Set node before the HTTP request to debug the final JSON structure that’s getting sent to Notion.

the notion node in n8n is prety outdated. i’ve switched to using the http request node for notion stuff - way more reliable. for your array issue, set the body type to json and use something like {\"children\": {{ $node[\"previous_step\"].json[\"blocks\"] }}} (just swap in your actual node name). make sure your blocks are already in notion’s format before passing them in.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.