task icon Task

Update Notion Page

Requirements
Page or entry to update (ID, URL, title, or recent reference), changes to make (property updates, content to add)
3

Identify the page or entry to update:

  • If user references "that page" or "the one I just created", check recent context
  • If user provides a URL, extract the page ID from it
  • If user provides a title, search uiConnection Profiles for matching pages/entries
  • If ambiguous, ask: "Which page do you want to update? [list recent options]"

Determine what needs updating:

  • Property changes: status, date, tags, priority, etc.
  • Content additions: new blocks to append
  • Both: property updates AND new content
4

For database entry updates:

6

Prepare the update with schema awareness:

For property updates:

  • Match property names EXACTLY (case-sensitive)
  • Use correct property types from schema (status vs select)
  • Only include properties being changed

View-critical property updates:

  • Changing date → ensures entry appears correctly in Calendar/Timeline
  • Changing status → ensures entry appears correctly in Board view

For content additions:

  • New blocks will be appended to the end of the page
  • Structure with appropriate block types (headings, paragraphs, lists)
7

Write a preview draft with _action frontmatter:


_action:
label: "Update page"
prompt: "Update this Notion page using the changes below."
isComplete: false

Page: [page title] ([page URL or ID])

Property Changes

  • [property] → [new value]

Content to Add

[new blocks in markdown, if any]

Sauna displays this as a preview card with an "Update page" button.
User can edit the changes, then click to apply.

8

Execute the update using Notion API:

  • Property changes: PATCH /pages/{page_id}
  • Content additions: PATCH /blocks/{page_id}/children

On success: Confirm what was updated and share the page URL.
On error: Explain the issue (common: page not shared, property name mismatch, invalid property type).

                    To run this task you must have the following required information:

> Page or entry to update (ID, URL, title, or recent reference), changes to make (property updates, content to add)

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 External Actions Guide]: Read the documentation in: `skills/sauna/[skill_id]/references/sauna.actions.external.md` (Preview UI pattern for external actions)

2. [Read Notion Guide]: Read the documentation in: `skills/sauna/[skill_id]/references/content.notion.guide.md` (Notion API reference for updates)

3. Identify the page or entry to update:
- If user references "that page" or "the one I just created", check recent context
- If user provides a URL, extract the page ID from it
- If user provides a title, search `documents/connections/[service-name].md` for matching pages/entries
- If ambiguous, ask: "Which page do you want to update? [list recent options]"

Determine what needs updating:
- **Property changes**: status, date, tags, priority, etc.
- **Content additions**: new blocks to append
- **Both**: property updates AND new content


4. For database entry updates:
- Check `documents/connections/[service-name].md` for the database's property schema
- If schema not in profile, run `skills/sauna/[skill_id]/scripts/notion.database.schema.js` to fetch it


5. [Gather Arguments: Get Notion Database Schema] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `databaseId`: database ID if updating database entry

6. [Run Code: Get Notion Database Schema]: Call `run_script` with:

```json
{
  "file": {
    "path": https://sk.ills.app/code/notion.database.schema/preview,
    "args": [
      "databaseId"
    ]
  },
  "packages": null
}
```

7. Prepare the update with schema awareness:

**For property updates:**
- Match property names EXACTLY (case-sensitive)
- Use correct property types from schema (status vs select)
- Only include properties being changed

**View-critical property updates:**
- Changing date → ensures entry appears correctly in Calendar/Timeline
- Changing status → ensures entry appears correctly in Board view

**For content additions:**
- New blocks will be appended to the end of the page
- Structure with appropriate block types (headings, paragraphs, lists)


8. Write a preview draft with _action frontmatter:

---
_action:
  label: "Update page"
  prompt: "Update this Notion page using the changes below."
  isComplete: false
---

**Page:** [page title] ([page URL or ID])

## Property Changes
- [property] → [new value]

## Content to Add
[new blocks in markdown, if any]

Sauna displays this as a preview card with an "Update page" button.
User can edit the changes, then click to apply.


9. Execute the update using Notion API:
- Property changes: PATCH /pages/{page_id}
- Content additions: PATCH /blocks/{page_id}/children

On success: Confirm what was updated and share the page URL.
On error: Explain the issue (common: page not shared, property name mismatch, invalid property type).