Overview
This node integrates with Notion to either fetch the content of a Notion page as Markdown or append Markdown content to an existing Notion page. It is useful for workflows that need to transform Notion pages into Markdown format for further processing, exporting, or documentation purposes, or to programmatically add content to Notion pages using Markdown syntax.
Practical examples:
- Exporting a Notion page's content as Markdown to use in static site generators or documentation tools.
- Appending meeting notes or updates written in Markdown directly into a Notion page as new blocks.
Properties
| Name | Meaning |
|---|---|
| Action | Choose between "Fetch Page" (retrieve a page's content as Markdown) or "Append Page" (append Markdown content to a page). |
| Page ID | The identifier or URL of the Notion page to retrieve or append content to. |
| Markdown | The Markdown text to append to the specified Notion page (required only when appending). |
Output
The node outputs JSON data with the following structure depending on the action:
Fetch Page:
markdown: A string containing the entire content of the specified Notion page converted into Markdown format.
Append Page:
pageId: The ID of the Notion page where the Markdown was appended.markdown: The Markdown content that was appended.
No binary data output is produced by this node.
Dependencies
- Requires a valid Notion API authentication token configured in n8n credentials.
- Uses the official Notion SDK client to interact with the Notion API.
- Utilizes external libraries for converting Notion pages to Markdown and for converting Markdown back to Notion blocks.
- No additional environment variables are required beyond the API credential.
Troubleshooting
Common issues:
- Invalid or missing Notion API credentials will cause authentication failures.
- Incorrect or malformed Page ID or URL may result in errors fetching or appending content.
- Large Markdown content might hit API limits; the node chunks appended blocks in batches of 75 to mitigate this.
Error messages:
- Errors related to API calls typically include context about the item index in batch processing.
- If the node is set to continue on failure, errors are returned alongside the input data for easier debugging.
- To resolve errors, verify the correctness of the Page ID/URL and ensure the API key has sufficient permissions.