Write to Notion
Requirements
What to create or update, target location, and content
Instructions
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).
5
If no style sections exist, offer to run Setup Notion Connection. If Notion section missing but others exist, use those as reference.
6
Determine the operation and parentType:
- 'database' — add entry to existing database
- 'page' — create page under another page
- 'inline_database' — create new database inside a page
- 'update' — modify existing page
Resolve the target fromConnection Profiles or search if needed.
7
Build the content in the user's voice:
- For database entries: properties JSON matching the database schema
- For pages: {title, icon} and optional blocks array
- For inline databases: {title, icon, schema} where schema defines columns
- For rich content: construct blocks array and write to
Notion Content Data
If content includes inline databases: create the page first, then call the script
again with parentType 'inline_database' for each database. Inline databases
cannot be created as blocks—they require a separate API call after the page exists.
8
Preview what you'll create/update and get confirmation before proceeding.
10
Confirm success and share the URL.
To run this task you must have the following required information:
> What to create or update, target location, and content
If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.
---
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).
Add all steps to your todo list now and begin executing.
## Steps
1. [Read Notion Agent Rules]: Read the documentation in: `./skills/sauna/[skill_id]/references/notion.workspace.rule.md` (Interpretation and property mapping)
2. [Read Notion API Reference]: Read the documentation in: `./skills/sauna/[skill_id]/references/notion.workspace.reference.md` (Properties and block types)
3. [Read Writing Style]: Read the file at `./documents/user/writing_style.md` and analyze its contents (User's writing style - prefer Notion section, fall back to any available)
4. [Read Learned Preferences]: Read the file at `./documents/preferences/learned.yaml` and analyze its contents (Check for past structure corrections (e.g., toggle usage, section ordering))
5. If no style sections exist, offer to run `./skills/sauna/[skill_id]/references/recipes/notion.workspace.setup.md`. If Notion section missing but others exist, use those as reference.
6. Determine the operation and parentType:
- 'database' — add entry to existing database
- 'page' — create page under another page
- 'inline_database' — create new database inside a page
- 'update' — modify existing page
Resolve the target from `./documents/connections/[service-name].md` or search if needed.
7. Build the content in the user's voice:
- For database entries: properties JSON matching the database schema
- For pages: {title, icon} and optional blocks array
- For inline databases: {title, icon, schema} where schema defines columns
- For rich content: construct blocks array and write to `./documents/tmp/notion-content.json`
If content includes inline databases: create the page first, then call the script
again with parentType 'inline_database' for each database. Inline databases
cannot be created as blocks—they require a separate API call after the page exists.
8. Preview what you'll create/update and get confirmation before proceeding.
9. [Gather Arguments: Create/Update Notion Content] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `parentType`: 'database', 'page', 'inline_database', or 'update'
- `parentOrPageId`: Parent/page ID
- `propertiesJson`: Properties JSON
- `contentPath`: ui:session.notion.content or empty
10. [Run Code: Create/Update Notion Content]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/notion.workspace.write/preview,
"args": [
"parentType",
"parentOrPageId",
"propertiesJson",
"contentPath"
]
},
"packages": null
}
```
11. Confirm success and share the URL.