Automations
notion_automationManage scheduled or condition-based Notion automation rules that update rows, append content, comment, or trash, with dry-run previews and undo.
Instructions
Manage and run automation rules (rules.json in the local state folder, or NOTION_PLUS_RULES). A rule has a when condition (same where/filter as notion_query, plus relative dates), a schedule ("weekdays 09:00", "daily 18:00", "hourly", cron), or both. Row actions apply to each matching row: {set: {...}}, {append: markdown}, {comment: text}, {trash: true}. then actions run once per firing: {refresh_chart: block_id}, {build_report: {...notion_build_report args}}, {create_page: {parent, title, …}}. Strings accept {{today}}, {{now}}, {{page.}}. A rule must stop matching a row after acting on it (write a value outside its condition, trash, or use marker). Actions: list, get, add, update (merge fields), validate (checks against the live schema and previews), dry_run (never writes), enable, disable, delete, run (writes; one undo_id per rule), history (recent runs, paged), waive (mark a rule's unfinished firing as handled), export / import (the rules file as JSON), deploy (the rules file plus steps to run it on a schedule in GitHub Actions). Each row's actions run in order with progress saved after each step: values that keep the row matching, then content and comments, then the marker or values that take it out of the condition, then trash. A failed row is retried next run from the step that failed, and a scheduled occurrence only counts as fired when all of it succeeded. run reports status succeeded, partial, or failed, and is an error unless every rule succeeded. list and get return the file's revision; pass it as expected_revision on edits so a change made elsewhere in the meantime isn't overwritten.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule | No | add: the whole rule; update: only the fields to change; validate: a rule to check without saving | |
| force | No | dry_run/run: ignore schedules and run now | |
| limit | No | history: runs per page. | |
| action | Yes | ||
| cursor | No | history: next_cursor from the previous page. | |
| rule_id | No | ||
| max_rows | No | run: rows acted on across all rules (default 200); the rest wait for the next run. | |
| timezone | No | Set the rules file's time zone (IANA, e.g. America/New_York). | |
| max_blocks | No | run: blocks appended (default 5000). | |
| rules_file | No | import: a whole rules file ({version: 1, timezone, rules: [...]}), e.g. from export. | |
| import_mode | No | import: merge adds or replaces rules by id; replace swaps the whole file. | merge |
| max_minutes | No | run: wall time (default 20). | |
| max_requests | No | run: Notion requests (default 3000). | |
| expected_revision | No | Edits: the revision from list/get. The edit is refused if the rules file changed since. |