Snag Watcher

Guides

Follow-up watchers

Some watches only work in order, like "when the store lists the new keyboard, tell me when it's under $200", since there's no page to watch for a price until it's listed. Put the second watcher in then, and when the first one matches, we create it on the page that matched.

JSON
{
  "target": { "query": "Q6 HE", "match": "line" },
  "conditions": { "all": [{ "field": "availability", "op": "=", "value": "in_stock" }] },
  "where": { "sites": ["keychron.com"], "aggregate": "first" },
  "schedule": { "every": "1h", "until": "+180d" },
  "then": {
    "conditions": { "all": [{ "field": "price", "op": "<", "value": 200 }] },
    "schedule": { "every": "6h", "until": "+90d" }
  }
}

What the follow-up gets

FieldValue
targetmatch: url on the page that matched, with the parent's attributes
conditions, scheduleFrom then
whereFrom then, or the site that matched
notifyFrom then, or the parent's
location, fetchThe parent's

The parent's matched event names it under then:

JSON
"then": [{ "url": "https://www.keychron.com/products/keychron-q6-he-wireless-custom-keyboard", "child_id": "wch_8s1d4f6g7h2j3k5l9q0w" }]

The follow-up has parent_id set, signs its webhooks with the parent's webhook_secret, and otherwise works like any other watcher.

Rules

  • The parent must stop at its first match, with until: "after_first_match" or aggregate: "first".
  • A then can't have its own then.
  • We check then when you create the parent, so a bad one fails right away. It can't have a version condition, since the follow-up watches one page and has no version to compare.
  • If we can't create the follow-up, the event has then_skipped instead of child_id: "limit" at the watcher limit, or an error code if the follow-up no longer passes our checks.

In the examples