HOC SiteDocumentation

Scheduled tasks

Lifecycle schedule events and schedule fields produce dated work. The task worker is what actually runs it.

Schedule fields

A schedule field stores dated slots: a validUntil, slots per weekday, blocked exact dates, blocked annual dates, and a maximum number of entries per slot. Booking forms use it to reject a date before the request reaches the server.

Schedule events

A lifecycle event can be schedule, with an anchorPath and an offsetDays between -3650 and 3650. The anchor is a date field on the entry; the offset moves the trigger. A reminder the day before a booking is an offset of -1.

What runs

The worker (npm run tasks:run) picks up due work. Lifecycle events can send email, create notifications, modify fields, create entries, adjust numbers, run integration queries, or update matching entries.

Because the worker is separate from the web process, a schedule does not depend on a visitor loading a page.

Idempotency

Integration runs and webhook handling use idempotency keys. A retry that repeats a key is recorded as a duplicate instead of being applied twice.