Set up automated backups for your Notion workspaces that run on a time-basis and notify you by Slack, Discord, or email, so you never worry about losing your Notion data again.
⚠️ This tool uses the Notion unofficial API, which means it could break at any time. I’ll try my best to keep it up to date, but you should be aware of this.
Click on the
Quick editbutton and Copy-paste the Script code into the editor.
Follow this guide to find your Notion token v2.
Navigate to your Worker > Settings > Variables and add the following secrets:
If you click the trigger export button again, you should receive a success message, and it will begin exporting your workspace. If you configured your Discord or Slack webhook url, you should receive a message in a few minutes, and you will also receive an email from Notion.
in order for the script to execute on a time-based, you must create a cron job task for it,
Navigate to Worker > Triggers > Cron Triggers and create a new cron trigger
0 0 * * *will cause the script to execute once everyday.
0 0 */10 * *will cause the script to execute once every ten days
Change export format to
To change the backup’s export format from html to markdown or PDF (enterprise plan), create a new environment variable called
EXPORT_TYPE and set its value to
Running project locally
- Linux or WSL
Steps to get server up and running
npm i -g wrangler
Login With Wrangler to Cloudflare