Create notion page blocks from AI response

This is how to properly format content for a Notion page.

In the user message for AI message model, you must format the output to use the Notion Block API, and also give an example of the json output with only the parts you need, which is only type and content

The output will be used to create Notion page blocks using the notion Block API. Use all possible blocks that are available from the Notion Block API. If using a bullet list, remember that each item is a type=bulleted_list_item, it is not all bullets in one list

Example output, an array of objects
[
{"type":"heading_2", "content":"Overview"},
{"type":"paragraph", "content":"This college...."},
...
]

Then using the code node, convert the message content into an array of json objects. Then use the Notion Append Block node to make all the blocks

Resulting Notion Page

1 Like