Guides
Follow-up watchers
Some watches only make sense in order: "when the store lists the new keyboard, tell me when it's under $200". Until it's listed, there's no page to watch for a price.
Put the second watcher in then. When the first one matches, we create it on the page that matched.
{
"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
| Field | Value |
|---|---|
target | match: url on the page that matched, with the parent's attributes |
conditions, schedule | From then |
where | From then, or the site that matched |
notify | From then, or the parent's |
location, fetch | The parent's |
The parent's matched event names it:
"then": [{ "url": "https://www.keychron.com/products/keychron-q6-he-wireless-custom-keyboard", "child_id": "wch_8s1d4f6g7h2j3k5l9q0w" }]The follow-up has parent_id set and works like any other watcher.
Rules
- The parent must stop at its first match:
until: "after_first_match", oraggregate: "first". - One level only. A
thencan't hold anotherthen. thenis checked when you create the parent, so a bad one fails right away.- If the account is at its watcher limit, the event says
"then_skipped": "limit"instead.