TL;DR: This beginner-friendly n8n workflow teaches you how to extract content from Notion pages as Markdown, then convert it back to Notion blocks — a foundational skill for building documentation pipelines, backup systems, or content migration tools. You'll learn when to use HTTP Request nodes instead of built-in integrations, and how Code nodes transform data between formats. By the end, you'll have a reusable template for any Notion-to-external-system workflow.
| Attribute | Details |
|---|---|
| Difficulty | ⭐ Level 1 (Beginner) |
| Who's it for | Anyone who uses Notion and wants to automate content extraction or backup |
| Problem solved | The default Notion node strips formatting — this workflow preserves bold, links, and structure |
| Template link | n8n.io/workflows/2901 |
| Tools used | Notion, n8n HTTP Request, Code node |
| Setup time | 15-20 minutes |
| Time saved | 2-4 hours per content migration project |
The Problem With Copying Things by Hand
David — my employer, the man who insists on "just quickly" copying meeting notes from Notion to a dozen different places — once spent an entire afternoon manually reformatting a 47-page document. Bold text? Gone. Links? Broken. That carefully crafted heading hierarchy? Flattened into a wall of text that would make a brutalist architect weep with joy.
The thing is, Notion stores content in a rather particular way. It's not just text — it's "blocks" with "rich text arrays" containing "annotations" for things like bold and italic. When you try to extract this content using most automation tools, you get the words but lose the formatting. It's like photocopying a painting: technically accurate, artistically tragic.
This workflow solves that problem. It reaches into Notion's block structure, extracts everything with full formatting intact, converts it to clean Markdown, and can even write it back. Think of it as a universal translator between Notion's internal language and the Markdown that the rest of the world understands.
What This Workflow Does
At its core, this workflow performs a seemingly simple task: it takes a Notion page, converts all its content to Markdown format, then converts that Markdown back into Notion blocks and appends them to the original page. Yes, this means it effectively triples your page content — which is useless on its own, but brilliantly demonstrates the round-trip conversion.
The real value isn't the tripling. It's the template. Once you understand how the conversion works in both directions, you can adapt this workflow to do genuinely useful things. Want to back up all your Notion pages to a GitHub repository as Markdown files? Take the first half. Want to publish blog posts written in Markdown directly to Notion? Take the second half. Want to migrate content from one Notion workspace to another while preserving formatting? Use both.
The workflow handles headings (all three levels), paragraphs, bulleted lists, numbered lists, to-do items, quotes, code blocks, and inline formatting including bold, italic, strikethrough, underline, code, and hyperlinks. That covers about 95% of what most people actually write in Notion.
Quick Start Guide
Before you can automate anything with Notion, you need to create an integration and share your pages with it. Head to notion.so/my-integrations and create a new internal integration. Give it a descriptive name — something like "n8n Automation" works nicely. Copy the secret token somewhere safe; you'll need it in a moment.
Now here's the step people always forget: Notion integrations can only access pages you explicitly share with them. Open the Notion page or database you want to automate, click the three-dot menu in the top right, select "Connections," and add your newly created integration. Without this step, your workflow will run perfectly but return absolutely nothing, leading to the special kind of frustration reserved for permission-related bugs.
In n8n, import this template and add your Notion credentials. The workflow uses both the official Notion node (for the trigger) and HTTP Request nodes (for the detailed block data). You'll need to configure credentials for both. Point the trigger at a database you own, make a small edit to any page in that database, and watch the magic happen.
Tutorial
Understanding the Architecture
This workflow splits into two parallel paths after the trigger, which is worth understanding because it demonstrates an important n8n pattern. The left path uses the built-in Notion node to get blocks. The right path uses an HTTP Request to get the same blocks but with full rich text data preserved. Both paths then convert to Markdown and merge back together before the write-back step.
Why two paths? Educational purposes. The creator wanted to show you the difference between "easy but lossy" and "slightly harder but complete." In your production workflows, you'll probably pick one approach. For anything involving formatting, pick the HTTP Request path.
The Notion Trigger
The workflow starts with a Notion Trigger node set to fire whenever a page is updated in a specific database. You'll need to select your database from the dropdown — make sure it's one you've shared with your integration. The trigger polls every minute by default, which is fine for testing but you might want to adjust for production.
When a page updates, the trigger outputs the page's metadata including its ID. This ID is what the subsequent nodes use to fetch the actual content.
Fetching Block Data via HTTP Request
The Get Child Blocks node is where the interesting work begins. Instead of using the built-in Notion node, it makes a direct API call to https://api.notion.com/v1/blocks/{page_id}/children. This returns the raw block data exactly as Notion stores it.
For Advanced Readers: The Notion API returns blocks as an array where each block has atypefield (like "paragraph" or "heading_1") and a corresponding object with the same name containing arich_textarray. Each rich text element has atextobject with the actual content and anannotationsobject describing formatting. Direct API access gives you all of this; the built-in node simplifies it but loses the annotations.
The Split Out Node
Notion's API returns all blocks in a single response object with a results array. The Split Out node takes this array and creates a separate item for each block. This is a common pattern in n8n: APIs return arrays, but you often want to process each element individually. After the split, if your page had 10 blocks, you now have 10 items flowing through the workflow.
Converting Blocks to Markdown
The Full Notion Blocks to Md code node is where the real transformation happens. It's a JavaScript function that iterates through Notion blocks and builds a Markdown string. The logic is straightforward: look at the block type, extract the text content, and wrap it in the appropriate Markdown syntax.
For Advanced Readers: The core conversion logic handles rich text annotations by checking each flag and wrapping content accordingly:The order matters here — you want links to wrap around formatted text, not the other way around.
The function handles nested formatting correctly. If you have bold text that's also a link, you'll get **[text](url)** in your Markdown output. This is the kind of detail that makes the difference between "works sometimes" and "works properly."
Converting Markdown Back to Blocks
The Md to Notion Blocks v3 node reverses the process. It takes Markdown text and produces an array of Notion block objects. This is genuinely useful because it means you can write content in Markdown anywhere and push it to Notion with proper formatting.
The conversion uses regular expressions to detect Markdown syntax and build the corresponding Notion structures. It handles all the same elements: headings, lists, quotes, code blocks, and inline formatting. The output is an array of properly structured blocks ready for the Notion API.
For Advanced Readers: The regex pattern /(\*\*|__)(.*?)\1|(_|\*)(.*?)\3|(`)(.*?)\5|(\[)(.*?)\]\((.*?)\)/g matches Markdown formatting in order of precedence. It's not the prettiest code, but it handles the common cases reliably. For production use, you might consider a proper Markdown parser, but for most automation tasks, this regex approach is fast and sufficient.Writing Back to Notion
The final step uses an HTTP Request to PATCH the blocks as children of the original page. The API endpoint is https://api.notion.com/v1/blocks/{page_id}/children and you send a JSON body with a children array containing your new blocks.
In this demo workflow, it appends the converted content to the same page, effectively tripling it. In a real workflow, you'd write to a different page, a different workspace, or skip the write-back entirely if you're just extracting content for use elsewhere.
Key Learnings
Built-in nodes aren't always enough. n8n's Notion node is convenient, but it simplifies the data in ways that might not work for your use case. When you need full control, HTTP Request nodes let you talk directly to the API. This pattern applies to many integrations: the built-in version handles 80% of use cases, but for the other 20%, you'll want direct API access.
Code nodes are transformers, not logic controllers. Notice how the Code nodes in this workflow do one thing: transform data from format A to format B. They don't make decisions, they don't branch, they don't call external services. Keep your Code nodes focused on transformation, and use n8n's built-in nodes for flow control. This makes workflows easier to debug and maintain.
Round-trip conversion validates your logic. By converting Notion to Markdown and back to Notion, you prove that both transformations work correctly. If the output doesn't match the input, you know something's wrong with one of the conversions. This is a useful testing pattern: if you can successfully round-trip data, your individual transformations are probably correct.
What's Next
You now have a template for any workflow involving Notion content. The obvious next step is to adapt it for something actually useful. Back up your Notion pages to GitHub as Markdown files — just remove the write-back portion and add a GitHub node. Or create a "publish to blog" workflow that takes Markdown from your drafts folder and pushes it to a Notion publishing database. The conversion code works; the creative part is deciding what to connect.
David, of course, looked at this workflow and asked if it could "automatically summarize meeting notes and send them to Slack." Yes, David. It can. You'd add an AI node between the Markdown conversion and the output. But that's a tutorial for another day — probably Tuesday, when we tackle Level 2 complexity and the terrifying power of connecting AI to your documentation.
For now, import this template. Break something. Fix it. The best way to learn automation is to automate something you actually care about, and discover all the edge cases the template author didn't think of. That's not a bug in the learning process — it's the entire point.
Ship it.
