Notion To Markdown icon

Notion To Markdown

Node to transform markdown and notion blocks

Overview

This node transforms content between Notion blocks and Markdown formats. It supports three operations:

  • Markdown to Notion: Converts Markdown text into Notion block structures.
  • Notion to Markdown: Converts Notion blocks into Markdown text.
  • Notion to Notion: Transforms Notion blocks into a different Notion block format (likely for normalization or modification).

Common scenarios include migrating content from Markdown-based sources into Notion, exporting Notion content as Markdown for use in other tools, or manipulating Notion blocks programmatically.

For example, a user might paste Markdown notes into the node to generate Notion-compatible blocks for import, or convert Notion page content into Markdown for publishing on a static site.

Properties

Name Meaning
Operation Choose the conversion direction:
- Markdown to Notion
- Notion to Markdown
- 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 Notion blocks JSON string to convert (used for Notion to Markdown and Notion to Notion operations)
Output Key The key name under which the output result will be stored in the node's JSON output object
Convert Images to Base64 Whether to convert images within Notion blocks to base64 encoding (only applies to Notion to Markdown). This is useful because Notion image URLs expire after 1 hour.

Output

The node outputs an object with a key defined by the "Output Key" property containing the conversion result:

  • 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 "Convert Images to Base64" is enabled, images are embedded as base64 data URIs instead of external URLs.
  • For Notion to Notion, the output is a transformed array of Notion blocks.

No binary data output is produced by this node.

Dependencies

  • Uses the external library @tryfabric/martian for converting Markdown to Notion blocks.
  • Uses local helper modules blocks-to-markdown and blocks-to-blocks for conversions from Notion blocks to Markdown and Notion blocks transformations respectively.

No special API keys or credentials are required for this node.

Troubleshooting

  • Invalid JSON input for Notion blocks: The "Input Notion Blocks" must be a valid JSON string representing Notion blocks. Malformed JSON will cause errors.
  • Empty or missing input: Providing empty strings for inputs will result in empty outputs or errors.
  • Image conversion issues: When "Convert Images to Base64" is enabled, large images may slow down processing or cause memory issues.
  • Operation mismatch: Using properties not relevant to the selected operation (e.g., providing Markdown input when operation is Notion to Markdown) will have no effect.

Error messages typically indicate the item index and the nature of the failure, helping identify problematic input data.

Links and References

Discussion