Notion MD icon

Notion MD

Node to transform markdown and notion blocks

Overview

This node transforms content between Notion blocks and Markdown format. It supports two main operations:

  • Markdown to Notion: Converts a Markdown string into an array of Notion block objects. This is useful when you want to programmatically create or update Notion pages using Markdown input.
  • Notion to Markdown: Converts an array of Notion blocks back into a Markdown string. This helps extract readable Markdown content from Notion data, for example, to export or process it elsewhere.

Typical use cases include syncing content between Notion and other Markdown-based systems, automating documentation workflows, or converting user input in Markdown into structured Notion pages.

Properties

Name Meaning
Input The text input to be transformed. For "Markdown to Notion", this should be a Markdown string. For "Notion to Markdown", this should be a JSON string representing an array of Notion blocks.
Output Key The key under which the transformed output will be stored in the node's JSON output object. Defaults to "output".

Output

The node outputs the transformed content under the specified output key in each item's JSON data:

  • For Markdown to Notion, the output is an array of Notion block objects representing the parsed Markdown content.
  • For Notion to Markdown, the output is a Markdown string reconstructed from the provided Notion blocks.

No binary data output is produced by this node.

Dependencies

  • Uses the external library @tryfabric/martian for converting Markdown to Notion blocks.
  • Relies on internal utility functions to convert Notion blocks back to Markdown.
  • No external API keys or credentials are required.
  • Requires the node to receive properly formatted input strings (Markdown or Notion blocks as JSON).

Troubleshooting

  • Invalid Operation Error: If an unsupported operation is selected, the node throws an error indicating the operation is unknown. Ensure the operation property is set to either "markdownToNotion" or "notionToMarkdown".
  • Input Format Issues:
    • For "Notion to Markdown", the input must be a valid JSON array of Notion blocks. Malformed JSON or incorrect structure will cause errors.
    • For "Markdown to Notion", invalid Markdown syntax might lead to unexpected results or empty output.
  • Unresolved Children Blocks Warning: When converting Notion blocks to Markdown, blocks with unresolved children are skipped with a warning comment inserted in the output. This indicates nested content that was not processed.
  • Unsupported Block Types: Some Notion block types may be ignored during conversion with a note in the output. This is normal if the block type is uncommon or unsupported.

Links and References

Discussion