Notion Node 2k Character API Limit: Workaround via Multiple Posts?

Hi, I am a new n8n user and this is my 1st post :slightly_smiling_face:

Notion has a 2,000 character limit in its API. This carries over to the n8n Notion node. I have a workflow to import Outlook emails to Notion and add the html email Body content to a new block on the Notion database page created from the email. However, I don’t know how to overcome the 2k content limit.

I imagine this is a simple matter of breaking the input content into <2k character segments and adding them separately into consecutive blocks (so the result reads as a continuous body, but is made up of <2k character parts).

However, I have no idea how to do this in n8n. I am not a programmer/coder so am looking for basic guidance on how to do this in layman’s terms.

Specifically:

  1. How do I truncate/limit the input to <2k characters?

  2. How do I do additional <2k characters posts picking up where the prior one ended and repeating until the full email body has been added to the notion body blocks?

If anyone can help, I’d greatly appreciate the assistance

Thanks vert much!!

Hi @ccclapp,
welcome to the community :wave:!

You can break down the text into smaller chunks using the Code node.
Then you can:

  1. Create a new Notion page where you insert the first part of the text
  2. Append Notion blocks to that page for the remaining text blocks

You can find an example here:

The only caveat with this solution is that Notion will add blocks and the result will looks something like this:

To fix this problem you should improve the logic in “Splits text in small chunks” (Code node) to split the text after a full stop.

Hope this helps,
let me know if you need more help

7 Likes

HI @giulioandreini

Thanks very much for your reply and illustration. That’s helpful.

I will try this and see how I do…

All the best

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