How to access the id of currently appended Notion Block?

Describe the issue/error/question

I am appending a TODO block inside an existing notion toggle block. The notion block gets appended successfully but I am unable to find the id of the newly appended notion block. The notion node only returns the id of the parent node to which the new node block was appended.

Information on your n8n setup

  • n8n version: 0.199.0:
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via n8n.cloud:

Hi @Ash, welcome to the community :tada:

n8n would typically return the response from the API the respective node is calling, so if you don’t get the data you’re looking for automatically you might need to perform a manual lookup afterwards.

That said, I just tried out the below workflow appending a block at the end of a page:

In this example, the ID of the page I am appending my block to is bd74aa7b-f82b-4c4f-9622-406f7b5c4a5c. After creating the block, I am receiving a different ID from Notion in the results field (7e323c15-4871-4156-ad06-f2b65cfbf185) which references the newly appended block:

This can also be seen when fetching all blocks on my page:

So, you might want to try appending to a page ID rather than after a block.

Hi @MutedJam,
Sorry for the late reply I was afk and missed the notification.

I checked the Notion API docs for appending block children. The API example also shows the id of newly added block.

I again tried using the notion block in n8n today and it also seems to return the correct id of the newly added block even when appending to an existing block.

I am not sure what caused the behaviour I experienced above but I will open this thread again if I find it.
Thanks for your help.

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