Quick overview
This workflow runs daily to normalize and backfill properties in a Notion database, standardizing Status values, deriving a Key slug and Created week stamp, updating only changed pages, and appending a run recap to a Notion log page.
How it works
- Runs every day at 3am on a schedule.
- Fetches all pages (rows) from a selected Notion database with full property data.
- Applies normalization rules to backfill missing Status values, canonicalize known Status variants, and optionally derive a Key slug from the title and a Created week value from the page creation time.
- Updates only the Notion pages where one or more of these derived values differs, and stamps a Last normalized date on each updated page.
- Appends a one-line recap of the run (scanned vs. updated counts and what changed) to a specified Notion page or block.
Setup
- Add a Notion API credential and share both the target database and the log page with your Notion integration.
- Select the Notion database to process in the database ID field used to fetch all database pages.
- Update the rules in the code configuration (property names, DEFAULT_STATUS, and the CANONICAL_STATUS mapping) to match your database.
- Ensure the target database has the mapped properties (Status, Key, Created week, Last normalized) with the expected types, and adjust the update mapping if your property names differ.
- Paste the URL of the Notion page/block that should receive the run recap into the append-to-block configuration.
Requirements
- A Notion internal integration credential, with both the target database and the log page shared with the integration
- A database with the mapped properties (Status, Key, Created week, Last normalized) in the expected types
Customization
- Edit DEFAULT_STATUS to change what gets backfilled into blank Status values
- Extend the CANONICAL_STATUS map to fold more spelling variants into your canonical values
- Rename the property keys in the rules block to match your own schema
- Point the run recap at a different Notion log page
- Adjust the schedule to run at a different time
Additional info
Only rows that actually change are written, so the workflow is idempotent and safe to schedule. A Status value that is present but not in the canonical map is never overwritten, and the Last normalized stamp is applied only on a real change, so clean rows stay untouched. Fully deterministic: the same row always resolves the same way. Test on a copy of your database first.