Error: Rich text entry in Notion Database

Environment

item value
n8n version 1.97.1 (Cloud)
Workflow ID redacted
Node Notion (n8n-nodes-base.notion) v2.2
Resource/Operation databasePage → create
Notion DB prop “Post Content” – type :black_small_square:︎ Rich text
Error NodeOperationError: texts is not iterable

Goal

Populate a Notion database with social-media posts.
“Post Content” must land in a Rich-Text property so that formatting links & hashtags survive.

What I’m sending to Notion

The Code node (second-to-last step) prepares every post like this:

js

CopyEdit

return items.map(item => {
  const posts = JSON.parse(item.json.message.content);

  return posts.map(post => {
    return {
      json: {
        ID          : post.ID,
        Name        : post.Name,
        Channel     : post.Channel,
        "Post Date" : new Date().toISOString().split("T")[0],
        Day         : post.Day,

        /*  ← Rich-Text payload (Notion expects an array of objects)  */
        "Post Content": [
          {
            type : "text",
            text : { content: post["Post Content"] }
          }
        ],

        "Source Blog" : post["Source Blog"],
        Status        : post.Status,
        Views         : null,
        "CTR %"       : null,
        Link          : ""
      }
    };
  });
}).flat();

How the Notion node is configured

  • Database: the correct DB (checked twice)
  • Post Content → Type: Rich text (created in Notion UI)
  • Post Content → Value: ={{ $json["Post Content"] }}
  • Everything else maps 1-for-1 and works.

Full error & stack-trace

json

CopyEdit

{
  "errorMessage": "texts is not iterable [item 0]",
  "n8nVersion": "1.97.1 (Cloud)",
  "nodeName": "Notion",
  "nodeVersion": 2.2,
  "time": "2025-06-19 16:43:32",
  "stackTrace": [
    "NodeOperationError: texts is not iterable",
    "    at prepareNotionError (…/nodes/Notion/shared/GenericFunctions.ts:1215:9)",
    "    at ExecuteContext.execute (…/NotionV2.node.ts:394:14)"
  ]
}

What I tried

  1. Verified the Rich-Text structure matches Notion API docs (array → object → text → content). developers.notion.com
  2. Confirmed other people see the same “texts is not iterable” message when the inner structure is wrong. community.n8n.io
  3. Re-created the DB property from scratch (type = Rich text).
  4. Switched the property to plain “Text” → works, but I lose formatting.

Ask

  • Is the JSON structure above correct for the Notion node?
  • Do I need an extra wrapper level (e.g. rich_text) before the array?
  • Any idea why the Notion node still thinks texts is not iterable?

Thanks a ton for looking into this! :folded_hands:

The Notion API requires that rich_text properties for databases be objects with the rich_text field containing an array of formatted blocks.

The n8n node assumes this structure. If the rich_text layer doesn’t exist, the error “texts is not iterable” appears because it attempts to iterate over an unexpected value.

Change the JSON structure in the Notion > Create or Update property node so that it includes the appropriate wrapper:
This is incorrect:

"Post Content": [
{ type: "text", text: { content: "..."} }
]

Try this structure:

"Post Content": {
"rich_text": [
{
"type": "text",
"text": { "content": "..." }
}
]
}

If you make it dynamic, it should look like this:

{
"Post Content": {
"rich_text": [
{
"type": "text",
"text": { "content": {{$json["Post Content"]}} }
}
]
},
"Source Blog": { "title": [ { "type":"text", "text":{ "content":$json["Source Blog"] } } ] }
// ... other fields
}