Overview
This node, named "Notion To Markdown," provides bidirectional transformation between Notion blocks and Markdown text. It supports three main operations:
- Markdown to Notion: Converts Markdown input into Notion block format.
- Notion to Markdown: Converts Notion blocks into Markdown text.
- Notion to Notion: Transforms Notion blocks into a different Notion block structure (likely for normalization or filtering).
This node is useful when integrating Notion content with systems that use Markdown or when manipulating Notion data programmatically. For example, you can export Notion pages as Markdown files or import Markdown notes into Notion.
Properties
Name | Meaning |
---|---|
Operation | Choose the conversion direction: "Markdown to Notion", "Notion to Markdown", or "Notion to Notion". |
Input Markdown | The Markdown text to convert into Notion blocks (used only if operation is "Markdown to Notion"). |
Input Notion Blocks | The Notion blocks JSON string to convert (used if 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. Default is "output" . |
Convert Images to Base64 | When converting Notion blocks to Markdown, optionally convert images to base64 encoding to avoid URL expiration issues. Only applicable for "Notion to Markdown" operation. |
Output
The node outputs the transformed data under the user-defined output key (default "output"
):
- For Markdown to Notion, the output is an array of Notion block objects representing the Markdown content.
- For Notion to Markdown, the output is a Markdown string generated from the Notion blocks. If enabled, images are embedded as base64 strings.
- 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 Markdown-to-Notion block conversion. - Uses local helper modules for Notion blocks to Markdown and Notion blocks transformations.
- No external API keys or credentials are required.
- Requires proper JSON formatting of Notion blocks when provided as input.
Troubleshooting
- Invalid JSON input for Notion blocks: Ensure the Notion blocks input is a valid JSON string; otherwise, parsing errors may occur.
- Empty or malformed Markdown input: Provide valid Markdown text for conversion.
- Image conversion issues: When enabling image base64 conversion, large images might increase processing time or memory usage.
- Operation mismatch: Using inputs incompatible with the selected operation (e.g., providing Markdown input for "Notion to Markdown") will not produce expected results.
- Errors during execution include item index and error description to help identify problematic input data.
- Use the node's "Continue On Fail" option to handle errors gracefully without stopping the workflow.
Links and References
- Notion API Documentation
- Markdown Syntax Guide
- @tryfabric/martian GitHub Repository (for Markdown to Notion conversion)