Noxical
PublishDocs

Run scripts on a schedule

Overview

An automation is a note with type: automation in its frontmatter and a script in a code block. It can notify you, or send a report to your Inbox or email. Automations only run while Noxical is open. A run missed while it was closed runs once when you return.

Example

---
type: automation
schedule: "*/30 * * * *"
notify: on-change
---

```sh
echo "::notify title=Hello::Message body"
```

Frontmatter

Field Default Meaning
type automation. Required.
schedule Cron (5 or 6 fields), or @hourly, @daily, @weekly, @monthly, @yearly. Leave out to run only by hand.
timezone Your machine's Time zone name, such as Asia/Hong_Kong.
enabled true false keeps it listed but never scheduled.
run Path of a script in the vault, instead of a code block.
args [] Arguments for the script.
notify always on-change notifies only when messages differ from the last run.
onFailure notify ignore only records failures.
timeout 60s 30s, 5m or seconds. At most 10m.
catchUp true Runs once on return after a missed run.
deliver Where the report goes: inbox, email, desktop, or a list.

Scripts

  • Code blocks can be sh, bash, zsh, python, node or ruby. Node is always available. The others come from your PATH.
  • Print ::notify title=Title::Message to send a notification, up to five per run.
  • Print ::skip::reason to stop quietly.
  • Python packages: declare them in a PEP 723 # /// script block. They install through uv.
  • Several code blocks run in order as steps. Each step receives the previous step's output on standard input.
  • A prompt code block asks Noxical AI. It can use the web and read-only plugin tools, and cannot read your files.
  • Scripts run from the vault root, with NOXICAL_VAULT, NOXICAL_AUTOMATION, NOXICAL_LAST_RUN and NOXICAL_INPUT set.

Reports

  • The output of the last step is the report. A first-line heading becomes its title.
  • inbox needs the Inbox plugin.
  • email goes through the Email plugin, only to the addresses set in its settings. A note cannot name a recipient.

Approval

A script must be approved before it runs. Approve automation script shows you the code.

Settings

Setting What it does
Folder for new automations Where New automation creates its note. Automations work in any folder.

Commands

  • Open automations
  • New automation
  • Run automation
  • Approve automation script

Your data

Automations are notes in your vault. Run history is in .noxical/plugins/automations/runs.json.