Every 15 minutes
Export finished Notion pages to Markdown
When a page is marked ready, you get it as Markdown by email and the page is marked as exported.
- Runs
- Every 15 minutes
- Apps
- Notion
- AI
- Not needed
- Access
- read+write
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, check my Notion Blog database for pages with Status set to Ready. Convert each one to Markdown, email it to me, and set its Status to Exported.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A documentation lead writes help articles in Notion, but the website, the support tool and the developer wiki all need Markdown or HTML. So every finished article gets copied out by hand, formatting breaks on tables and toggles, and someone forgets to re-export after the last revision. The published version drifts away from what the team actually approved.
Every 15 minutes, the Notion database is checked for pages marked ready. For each one, all nested blocks are fetched (headings, lists, callouts, code, toggles inside toggles), converted into clean Markdown or HTML and emailed to you with the page title as the subject. The page's status is then set to Exported so it is not sent twice.
It also fits teams who archive meeting notes, publish a changelog, or hand finished copy to an agency.
What you get out of it
Published text matches approved text
The file you receive is generated from the Notion page at the moment it was marked ready, so the version on your site cannot quietly lag behind the final draft the team signed off on.
No more broken formatting from copy and paste
Nested lists, tables, callouts and code blocks are converted from the block structure itself. That avoids the stray characters and flattened indentation that appear when pages are pasted into another writing tool.
Writers stay in one tool
Authors keep drafting where they are comfortable and only flip a status. Developers get the file in a format their static site generator or help center already accepts. That keeps the writing workflow unchanged for the whole team.
Nothing is exported twice
Setting the status to Exported after each send prevents duplicate emails for the same page, so the inbox does not fill with identical attachments and nobody wonders which one is current.
A trail of every release
Each email is a timestamped snapshot of a page, handy when someone asks what the pricing page said before the rewrite or when a legal review needs the earlier text.
How it works
What happens, step by step
Every 15 minutes ClickRuntime checks your Notion database for pages marked as ready.
It reads each page, including headings, lists and nested blocks.
The page is turned into clean Markdown and emailed to you.
The page's status is set to Exported so it isn't sent again.
Before it runs live
- Connect Notion and share the database you want it to use
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Notion steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, report_fetched, credentials, http, notify
NOTION = "https://api.notion.com/v1"
def headers():
return {"Authorization": f"Bearer {credentials.secret('NOTION_TOKEN')}", "Notion-Version": "2022-06-28"}
def query(db, body=None):
resp = http.post(f"{NOTION}/databases/{db}/query", headers=headers(), json=body or {})
resp.raise_for_status()
return resp.json()["results"]
def title(page, prop="Name"):
return "".join(t["plain_text"] for t in page["properties"][prop]["title"])
BLOG = "blog-database-id"
PREFIX = {"heading_1": "# ", "heading_2": "## ", "heading_3": "### ", "bulleted_list_item": "- ",
"numbered_list_item": "1. ", "quote": "> ", "paragraph": ""}
def to_markdown(page_id):
blocks = http.get(f"{NOTION}/blocks/{page_id}/children", headers=headers(), params={"page_size": 100}).json()["results"]
lines = []
for b in blocks:
rich = b.get(b["type"], {}).get("rich_text", [])
if b["type"] in PREFIX:
lines.append(PREFIX[b["type"]] + "".join(t["plain_text"] for t in rich))
return "\n\n".join(lines)
@on_trigger
def run(event):
pages = query(BLOG, {"filter": {"property": "Status", "select": {"equals": "Ready"}}})
report_fetched(len(pages))
if not pages:
return {"summary": "Nothing ready"}
for p in pages:
notify.email_me(f"Exported: {title(p)}", f"# {title(p)}\n\n{to_markdown(p['id'])}")
http.patch(f"{NOTION}/pages/{p['id']}", headers=headers(),
json={"properties": {"Status": {"select": {"name": "Exported"}}}}).raise_for_status()
return {"exported": len(pages)}FAQ
Common questions
How does it know a page is ready to export?
Are images and embedded files included in the export?
Can it send HTML for some pages and Markdown for others?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get alerts when a Notion value goes out of range
When a reading or metric in your database passes your limit, you hear about it once, not on every check.
See how it worksPost Notion database changes to Slack
Your team hears when a project is added or its status changes, without checking Notion.
See how it worksSummarise and tag new feedback in Notion
Each new feedback row gets a summary, a sentiment and tags, so you can sort and filter it without reading every entry.
See how it worksKeep exploring
Set up “Export finished Notion pages to Markdown” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.