Overview
The "Notion Markdown" node transforms content between Markdown format and Notion blocks, supporting three operations: converting Markdown to Notion blocks, Notion blocks to Markdown, and transforming Notion blocks into a different Notion block structure. This node is useful for users who want to integrate or migrate content between Markdown-based systems and Notion, automate documentation workflows, or manipulate Notion data programmatically.
Practical examples:
- Convert user-written Markdown notes into Notion blocks to import them into a Notion workspace.
- Export Notion page content as Markdown for use in static site generators or other Markdown-based tools.
- Reformat or filter Notion blocks before sending them to another system or API.
Properties
| Name | Meaning |
|---|---|
| Operation | Choose the transformation type: "Markdown to Notion", "Notion to Markdown", or "Notion to Notion". |
| Input Markdown | The Markdown text to convert into Notion blocks (used only when Operation is "Markdown to Notion"). |
| Input Notion Blocks | The JSON string representing Notion blocks to convert or transform (used when Operation is "Notion to Markdown" or "Notion to Notion"). |
| Output Key | The key under which the output result will be stored in the node's JSON output object. |
| Convert Images to Base64 | When converting Notion blocks to Markdown, whether to convert images to base64 encoding to avoid URL expiration issues. Only applicable for "Notion to Markdown" operation. |
Output
The node outputs an object with a JSON field containing the transformed content under the specified output key:
- For Markdown to Notion, the output is an array of Notion block objects representing the input Markdown.
- For Notion to Markdown, the output is a Markdown string generated from the input Notion blocks. If enabled, images are embedded as base64 strings.
- For Notion to Notion, the output is a transformed array of Notion blocks (structure depends on the internal transformation logic).
No binary data output is produced by this node.
Dependencies
- Uses the external library
@tryfabric/martianfor converting Markdown to Notion blocks. - Uses local modules
blocks-to-markdownandblocks-to-blocksfor converting Notion blocks to Markdown and transforming Notion blocks respectively. - Requires no special credentials but expects valid JSON strings for Notion blocks input.
- No environment variables or API keys are needed.
Troubleshooting
- Invalid JSON input for Notion blocks: Ensure that the "Input Notion Blocks" property contains properly formatted JSON. Malformed JSON will cause parsing errors.
- Empty or invalid Markdown input: Providing empty or malformed Markdown may result in empty or unexpected Notion blocks.
- Image conversion issues: When enabling image base64 conversion, large images might increase processing time or memory usage.
- Error messages: Errors during processing include the item index and message. Common causes are invalid inputs or unsupported content structures.
- To resolve errors, verify input formats and ensure the correct operation is selected matching the input type.
Links and References
- Notion API Documentation
- Markdown Syntax Guide
- Martian Library on GitHub – used for Markdown to Notion block conversion