Use when notion Automation Hub — API, Database, and Page management for knowledge bases, project trackers, and content systems. Monetize through workspace automation-as-a-service.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
The command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Showing SKILL.md
SKILL.md
Source instructions · Read-only preview
name
notion-integration
description
Use when notion Automation Hub — API, Database, and Page management for knowledge bases, project trackers, and content systems. Monetize through workspace automation-as-a-service.
# Notion Integration Token — create at https://www.notion.so/my-integrationsexport NOTION_TOKEN="secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"# Share target database/page with your integration# → Open the page → Share → Invite your integration by name
Rate limits: 3 requests/second per integration. Requests beyond are queued (not dropped) up to a burst of 30. Batch operations by sleeping ~350ms between calls.
Concrete Action Flows
Flow 1: Database Query with Filters
Query a Notion database with complex filters — the core building block for any automation:
Schedule blog posts by setting a "Publish Date" field and running a checker:
#!/usr/bin/env python3"""content-pipeline.py — Auto-publish content when publish date arrives."""import os, requests, datetime, time
NOTION_TOKEN = os.environ["NOTION_TOKEN"]
HEADERS = {
"Authorization": f"Bearer {NOTION_TOKEN}",
"Notion-Version": "2022-06-28",
}
DB_ID = "YOUR_CONTENT_CALENDAR_DB_ID"# Query pages where Publish = today and Status = "Ready"
today = datetime.date.today().isoformat()
results = query_db(DB_ID, filter_obj={
"and": [
{"property": "Publish Date", "date": {"equals": today}},
{"property": "Status", "status": {"equals": "Ready"}},
]
})
for page in results:
props = extract_properties(page)
title = props.get("Title", "Untitled")
content = props.get("Content", "")
# Publish to your platform (e.g., write to local markdown)
slug = title.lower().replace(" ", "-").replace("?", "").replace("/", "-")
withopen(f"_posts/{today}-{slug}.md", "w") as f:
f.write(f"---\ntitle: {title}\ndate: {today}\n---\n\n{content}\n")
# Mark as published in Notion
update_page(page[], {
: {: {: }},
: {: },
})
()
overdue = query_db(DB_ID, filter_obj={
: [
{: , : {: today}},
{: , : {: }},
]
})
p overdue:
props = extract_properties(p)
()
Flow 6: Bulk Archive/Delete
Clean up stale pages:
#!/usr/bin/env python3"""Archive pages matching a filter (Notion = move to trash)."""import os, requests, time
NOTION_TOKEN = os.environ["NOTION_TOKEN"]
HEADERS = {
"Authorization": f"Bearer {NOTION_TOKEN}",
"Notion-Version": "2022-06-28",
}
defarchive_page(page_id):
url = f"https://api.notion.com/v1/pages/{page_id}"
resp = requests.patch(url, headers=HEADERS, json={"archived": True})
resp.raise_for_status()
return resp.json()
# Archive completed tasks older than 90 days
old_tasks = query_db("YOUR_DB_ID", filter_obj={
"and": [
{"property": "Status", "status": {"equals": "Done"}},
{"property": "Completed Date", "date": {"before": "2025-04-16"}},
]
})
for t in old_tasks:
archive_page(t["id"])
print(f"Archived: {extract_properties(t).get('Task Name', '?')}")
time.sleep(0.35)
First Action in 60 Minutes
00:00-05:00 — Go to https://www.notion.so/my-integrations and create an integration
05:00-08:00 — Copy the integration token and store as NOTION_TOKEN
08:00-12:00 — Create a test database in Notion with 3+ columns (Name, Status, Priority)
12:00-15:00 — Share the database with your integration (Share → Invite)
15:00-25:00 — Run query_db.py to fetch all rows — verify it works
25:00-35:00 — Create a new row via the API — verify it appears in Notion
35:00-45:00 — Set up a Stripe → Notion CRM sync script
45:00-55:00 — Run the pipeline and push a test customer
55:00-60:00 — Add a weekly report cron (crontab -e) and set up content pipeline
By the end of 60 minutes:
Notion integration authenticated and functional
Database query/filter/create/update working
CRM sync script ready for client onboarding
Weekly report automation scheduled
Content publishing pipeline validated
Reusable deliverables to sell as workspace automation
Anti-Rationalization Table
Rationalization
Reality
"I can just manually update Notion"
Manual entry doesn't scale past 20 records. Automate creation and updates from day one.
"Database schema can be fixed later"
Notion has no migration tools. Changing property types after data is entered requires rebuilding. Design upfront.
"Rate limits are high enough"
At 3 req/s, bulk imports of 5000+ records take 25+ minutes. Build batching into every sync.
"Relations are optional"
Without relations, you get duplicated data and sync hell. Normalize early.
"The API is just read-only"
Full CRUD + block manipulation + comments + search. You can build a mini-app entirely in Notion.
"No one pays for Notion setup"
Companies with 50+ employees pay $500-2K/mo for workspace optimization. It's a recurring need.