Trawl

Schedule

A schedule runs your scrap on its own, at the times you pick, and Trawl pauses it when it keeps failing.

Turn a schedule on

Open your scrap's Settings → Schedule and toggle Schedule. Pick a preset or enter your own cron expression.

Preset Cron expression Good for
Every 5 minutes */5 * * * * Price tracking, stock alerts
Every 15 minutes */15 * * * * News, social feeds
Every 30 minutes */30 * * * * Marketplace listings
Hourly 0 * * * * General monitoring
Every 6 hours 0 */6 * * * Daily check-ins without overload
Every 12 hours 0 */12 * * * Twice-a-day snapshots
Daily 0 0 * * * Daily digests, reports
Weekly 0 0 * * 0 Weekly roundups

From every 30 minutes up to weekly, each run starts after a random delay, so scraps on the same preset do not all start at the same second: up to 5 minutes for every 30 minutes, 10 minutes for hourly, 30 minutes for every 6 or 12 hours, 1 hour for daily and weekly, and 2 hours for monthly (0 0 1 * *). The scrap keeps the expression above. Every 5 and every 15 minutes start on time, and so does your own expression unless it is written exactly like one of these presets.

Write your own cron expression

Any valid 5-field cron expression works:

  • 30 9 * * 1-5 — weekdays at 9:30 AM
  • 0 8,20 * * * — every day at 8 AM and 8 PM
  • 0 0 1 * * — the first day of every month at midnight

Schedules run in UTC unless you set a timezone in Settings → Schedule → Timezone. Any IANA name works (Europe/Paris, America/New_York).

┌───────── minute (0-59)
│ ┌─────── hour (0-23)
│ │ ┌───── day of month (1-31)
│ │ │ ┌─── month (1-12)
│ │ │ │ ┌─ day of week (0-6, Sunday=0)
│ │ │ │ │
* * * * *

Compute balance

A scheduled run is paid from your compute balance, like any other run. When the balance is empty, scheduled runs are skipped: they cost nothing and your schedule stays as you set it. They start again once you have units. On Free, the 10,000 welcome units are given once and do not come back.

When a scrap keeps failing

If a scrap fails three runs in a row, Trawl stops its scheduled runs for a while. A site that is down, blocked or rebuilt fails at every tick; there is no point spending your quota on it every hour.

  • Every run counts towards the three: scheduled, manual and API. A run that comes back far shorter than usual counts as a failure too (Data quality).
  • Only scheduled runs stop. You can still run the scrap yourself from the workspace, the API or the CLI; that is how you test a fix. A manual run that fails counts towards the three, and one that comes back clean clears them.
  • Your schedule stays as you set it, and skipped runs cost you nothing.

It comes back on its own:

  • After about two weeks without a real run, Trawl lets the next scheduled run through to check the site again.
  • The first clean run (that check, or a manual run) clears the state, and the schedule resumes at the next tick. A run that comes back far too short does not clear it.

In the scrap list, the status icon next to the title turns into a red circle as soon as the third failure counts; hover it to read why. trawl list --unhealthy lists every scrap in this state (CLI).

If you have set an alert recipient, you get one email when a scrap enters this state, and again only after a clean run followed by three new failures. A scrap with no schedule gets the same email, with nothing to pause (Notifications).

What happens on each run

  1. The schedule starts the scrap at its time. Manual and API runs skip this step.
  2. A worker runs the request script.
  3. The run is stored with its status, in the same run list for every kind of run.
  4. Notifications go out, if you set them.
  5. The AI Digest is written and emailed, if it is on.

A scrap that failed its last three runs skips step 1 for scheduled runs (see above). Manual and API runs always run.


See also: Notifications · AI Features · Scraping

Next step → Notifications