Notion Markdown Converter
AI-generatedOverview
This node converts data between Notion JSON block format and Markdown text. It detects whether the input is a Notion JSON structure representing content blocks or a Markdown string, then transforms it into the other format accordingly.
Common scenarios where this node is useful include:
- Exporting Notion page content as Markdown for use in static site generators, documentation, or blogs.
- Importing Markdown content into Notion by converting it into Notion's JSON block format.
- Automating content synchronization between Notion and Markdown-based systems.
For example, you can feed a Notion API response containing page blocks to this node to get a Markdown representation of the page, or provide Markdown text to generate Notion-compatible JSON blocks for further processing or upload.
Properties
| Name | Meaning |
|---|---|
| Source Data | The data to convert. Can be either Notion JSON blocks or a Markdown string. Defaults to using the entire input item ($json). |
Output
The output contains a single JSON field with the conversion result:
When converting from Notion JSON blocks to Markdown, the output JSON has these fields:
markdown: A string containing the Markdown representation of the Notion content.blocksCount: Number of Notion blocks processed.direction: Always"notion_to_markdown"indicating the conversion direction.
When converting from Markdown to Notion JSON blocks, the output JSON includes:
blocks: An array of Notion block objects representing the parsed Markdown content.blocksCount: Number of blocks generated.direction: Always"markdown_to_notion"indicating the conversion direction.
No binary data output is produced by this node.
Dependencies
- No external services or API keys are required.
- The node relies on internal logic to parse and convert between Notion JSON and Markdown formats.
- No special environment variables or n8n credentials are needed.
Troubleshooting
Error: "No input data provided."
This occurs if the node receives no input items. Ensure that the node is connected to a previous node providing data.Error: "Unable to detect input format. Expected Notion JSON blocks or markdown string."
This means the input data does not match expected formats. Verify that the input is either valid Notion JSON blocks (an object/array with recognized block types) or a Markdown string.If conversion results seem incorrect, check that the input data structure matches what the node expects:
- For Notion JSON input, it should have an
objectproperty with value"list"and aresultsarray, or be an array of blocks. - For Markdown input, it should be a plain string or an object with a
markdownstring property.
- For Notion JSON input, it should have an
Large inputs are split intelligently to avoid exceeding length limits during parsing.
Links and References
- Notion API Documentation — Understanding Notion block structures.
- Markdown Guide — Markdown syntax reference.
- n8n Documentation — General information about creating and using nodes in n8n.