GTM Engineering term, automation and APIs

Cron job

A cron job is a task scheduled to run automatically at fixed times or intervals, defined by a cron expression that sets the minute, hour, day and month.

Also called: cron, scheduled job, cron expression, crontab, scheduled trigger

Cron job sits under every stage: it's part of the data and systems the whole funnel runs on, near related terms like Polling, Trigger and Event-driven architecture (the blue squares).

A cron job is a task that runs automatically on a schedule, defined by a cron expression like 0 7 * * 1-5 (7:00 AM every weekday). The name comes from the Unix scheduler, but every automation platform and cloud provider has an equivalent. In GTM, cron jobs run the batch work: nightly enrichment refreshes, weekly pipeline digests and hourly cleanup passes.

How it works

A standard cron expression has five fields, left to right:

  1. Minute (0 to 59)
  2. Hour (0 to 23)
  3. Day of month (1 to 31)
  4. Month (1 to 12)
  5. Day of week (0 to 6, Sunday is 0)

An asterisk means "every." Commas list values, hyphens set ranges and a slash sets steps. A few useful patterns:

  • 0 2 * * *: every day at 2:00 AM.
  • */15 * * * *: every 15 minutes.
  • 0 8 * * 1: Mondays at 8:00 AM.
  • 0 6 1 * *: the first of every month at 6:00 AM.

The scheduler checks the clock, and when the expression matches, it starts your job: a script, a serverless function or a workflow in n8n, Make or Zapier. In automation tools, the scheduled trigger is just a cron job with a friendlier interface.

Example

Say you refresh firmographics on 20,000 accounts to fight data decay. Option A re-enriches every account nightly. Option B runs a weekly cron job that only re-enriches accounts not refreshed in 90 days, which might be about 1,600 accounts a week (assumption: refreshes spread evenly over roughly 12.5 weeks).

Option A costs 20,000 x 30 = 600,000 lookups a month. Option B costs about 1,600 x 4.3 = 6,900. At $0.02 a lookup (assumption), that's $12,000 versus about $138 a month for data that's nearly as fresh for planning purposes.

Cron vs event triggers

Cron fits work where a short delay is fine and batching saves money: refreshes, rollups, reports, reconciliation checks and dedupe passes. Event triggers fit work where minutes matter: inbound routing, signup alerts, meeting handoffs. Using cron-based polling for speed-to-lead work adds delay equal to half the interval on average.

The best stacks use both. Events handle the real-time path, and a nightly cron job reconciles anything an event missed. If you're moving toward event-driven architecture, that safety net stays useful.

Common mistakes

  • Forgetting the scheduler runs in UTC, so jobs fire at the wrong local time and shift with daylight saving.
  • Letting a long job overlap with its next run, which double-processes records.
  • No alert when a scheduled job silently stops running. Good observability tracks the last successful run.
  • Running heavy jobs at the top of the hour alongside every other scheduled job.
  • Scheduling daily what only needs weekly, and paying for it in credits and API limits.

FAQ

What does a cron expression like 0 7 * * 1-5 mean?

The five fields are minute, hour, day of month, month and day of week. So 0 7 * * 1-5 means minute 0 of hour 7, any day of the month, any month, Monday through Friday: 7:00 AM every weekday in the scheduler's time zone.

What time zone do cron jobs use?

It depends on where they run. Many servers and cloud schedulers default to UTC, while automation tools often use the workspace time zone setting. Always confirm it, because a report meant for 8 AM Eastern can land at 3 AM or 4 AM.

What is the difference between a cron job and a webhook?

A cron job runs on a clock whether or not anything changed. A webhook runs when a specific event happens. Use webhooks for anything time-sensitive and cron for batch work like nightly refreshes and weekly reports.

See all automation and APIs terms ↳

Used in these articles