Connect a monitor to an action
writ_wire_monitorWire a monitor's change event to an action: run a workflow, send notifications, or wake an AI agent to respond when a watched page changes.
Instructions
Wire a monitor's change_detected event to an action. action='workflow' runs a saved workflow when the monitored page changes; action='notify' sends a notification (provide channels + recipients the account has configured); action='ai_task' WAKES AN AI AGENT with a task prompt — the agent opens the monitored page in a cloud browser, sees what changed (diff + extracted values) and works the prompt autonomously (add channels/recipients to also get notified when it finishes). Use after writ_create_monitor to make the monitor DO something on change. A PRICE watch takes threshold: the action then runs ONCE, when a check reads a price at or below it (threshold_op picks the side) — not on every change. AUTO-BUY: action='workflow' with a checkout workflow and buy (payment {kind, ref} from writ_payment, approval, spend cap) makes it a purchase, always saved as a rehearsal (dry run) that stops before the order is placed; the user turns real purchases on in the Writ app.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| buy | No | action='workflow' only: the workflow is a CHECKOUT and runs as a purchase. Always saved with dry_run on (a rehearsal that stops before placing the order), whatever is sent; the user arms real purchases in the Writ app. Cloud monitors only. | |
| name | No | Optional automation name. | |
| title | No | ||
| action | Yes | What to do on a detected change. | |
| device | No | A linked Writ desktop's agent_id (writ_devices): act ON it. Omit to use the desktop this connection chose with writ_devices action='use' (if any). | |
| prompt | No | action='ai_task': what the agent should do when the monitor fires, e.g. "Check whether the price dropped below $500 and summarize what changed". Supports {{placeholders}} like {{diff_snippet}} and {{extracted.price}}. | |
| enabled | No | ||
| message | No | Notification body template (supports {{event.url}}). | |
| channels | No | Notification channels, e.g. ["pushover","email"] — required for action='notify'; optional with action='ai_task' (finish alert). | |
| workflow | No | Workflow to run (name) — required for action='workflow'. | |
| entry_url | No | action='ai_task': page the agent starts on (defaults to the monitored URL). | |
| max_steps | No | action='ai_task': cap on agent steps per wake (default 20, max 100). | |
| threshold | No | Price watch: act only when the watched price reaches this number (e.g. 477.04), once; by default at or below it (see `threshold_op`), and a price on the other side, or one the page no longer shows, does nothing. The monitor must read the price (a selector or extract, not a visual zone). Omit it for an alert on any change. Works for a desktop monitor too (`device`). | |
| monitor_id | Yes | Monitor id from writ_create_monitor. | |
| recipients | No | Notification recipients, e.g. ["pushover:1"]. OMIT to reach EVERY enabled recipient on the channel — the answer names who the alert actually reaches, and warns when nobody is configured. | |
| workflow_id | No | ||
| threshold_op | No | Which side of `threshold` fires: lte = at or below (default: "drops to 477.04" fires at 477.04), lt = strictly below ("below / under / less than"), gte = at or above, gt = strictly above (a rise alert). Pass what the user's words say. | |
| ai_session_id | No | action='ai_task': re-run this saved AI session instead of (or as well as) a prompt. | |
| cooldown_minutes | No | action='ai_task': minimum minutes between wakes (default 10; 0 disables). |