Scheduled tasks and daily timeline
This page describes the stock and ordering engine over time: which scheduled tasks run, at what time, in what order, and why that order matters. Ordering is event-driven: every customer order recomputes the supplier orders within a minute. Scheduled tasks therefore do not carry the main load; they act as safety nets and consolidation passes around that real-time flow. For the scale above (supplier waves, customer rounds, when to count), see A typical week.
The times on this page are an example configuration, expressed in the merchant's local time. The cadences (every 30 min, every 3 h, every 2 h) and the order of the morning passes are what matters; the exact times depend on how your account is set up.
Scheduled tasks
| Task | Cadence (example) | Changes data? | Role |
|---|---|---|---|
| PrestaShop order sync | every 3 h | yes (orders) | Imports customer orders from the last 40 days. Never decrements stock. |
| PrestaShop product sync | every 3 h | yes (products, vendors) | Products changed recently: prices, references, vendor links. Any stock write goes through the ledger. See PrestaShop synchronization. |
| Supplier-order generation | every 30 min | yes (drafts) | Creates and adjusts supplier-order drafts. Safety net behind the real-time recalculation. |
| Supplier email preparation | 07:00 | yes (previews) | Prepares the email of each draft that has no preview yet, without sending it, and records a fingerprint of its lines. A preview you edited is never overwritten. |
| Health check | 07:30 | no (read-only) | Measures whether supplier orders match what customer orders and stock call for, for daily monitoring. |
| Supplier-order reconciliation | 08:15 | yes (drafts) | Recomputes the expected state from customer orders and applies the minimal difference. The only pass that fills supplier orders for products without stock tracking. |
| Automatic validation | every 2 h (at :01) | yes (receptions, deliveries, stock) | Seals supplier receptions and customer deliveries that nobody confirmed. |
| Automatic sending (optional) | every 15 min | yes (sends emails) | Sends the drafts that are due, at their send slot, for vendors with automatic sending enabled. Off by default, turned on vendor by vendor. |
Automatic validation can run several times in the same slot safely: it skips anything already sealed and never seals the same line twice.
The day at a glance
The background rhythm (30 min and 3 h) runs around the clock. The one-off morning passes (07:00 → 08:15) form the consolidation sequence detailed below. Automatic validation sweeps every 2 hours.
A typical day as a Gantt chart
Durations are illustrative (a few minutes each); the sequencing is what matters:
gantt
title Typical day (example, local time)
dateFormat HH:mm
axisFormat %H:%M
section PrestaShop sync
Orders + products (07:00 pass) : 07:00, 20m
Orders + products (10:00 pass) : 10:00, 20m
section Ordering
Supplier orders 07:00 : 07:00, 5m
Supplier orders 07:30 : 07:30, 5m
Supplier orders 08:00 : 08:00, 5m
section Emails
Preview preparation : milestone, 07:00, 0m
section Checks
Health check (read-only) : 07:30, 10m
Reconciliation : 08:15, 15m
section Stock safety net
Automatic validation : 11:01, 10m
The morning order
The 07:00 → 08:15 window follows a set order:
- Email preparation (07:00) first. Each supplier-order draft gets a preview of its email and a fingerprint of its lines. You review these previews in the back office's review queue before sending; preparing them early leaves you the morning to review.
- Health check (07:30) next. It changes nothing. It measures the state after the preparation and after the first generation passes, which keeps its indicators comparable from one day to the next.
- Reconciliation (08:15) last. It recomputes the expected supplier-order state from customer orders and applies the difference. It runs after the 07:00, 07:30 and 08:00 generation passes to catch what they missed, and it is the only pass that fills supplier orders for products without stock tracking.
The fingerprint protects what you reviewed. If the 08:15 reconciliation changes a draft prepared at 07:00, or if its send slot moves, the preview no longer matches: sending from the review queue is blocked and the queue offers "Re-prepare". What you reviewed is what gets sent, never stale quantities.
A morning, hour by hour
Three things start at once:
- The supplier-order generation pass adjusts the drafts.
- Email preparation creates a preview for drafts that have none and records each draft's fingerprint.
- The PrestaShop syncs (orders and products) run. The product sync follows the same path as the real-time webhooks.
The health check measures, read-only, whether supplier orders match what customer orders and stock call for. Its results feed the back-office indicators. The 07:30 generation pass runs alongside it.
Reconciliation recomputes the expected state and applies the minimal difference: additions, updates and removals. A draft that is no longer needed at all is cancelled, with its origin recorded, not deleted. A line that is no longer needed is removed from its draft, unless you entered its quantity yourself. Orders already sent to the supplier are left as they are. This pass catches what the 07:00, 07:30 and 08:00 generation passes missed and covers products without stock tracking.
If a draft prepared at 07:00 changes here, its fingerprint drifts and its email stays blocked until "Re-prepare".
Every customer order creation, update or cancellation triggers a supplier-order recalculation within about thirty seconds. Generation sweeps behind it every 30 min, and the PrestaShop syncs come back at 10:00. You review the email queue and trigger sends: sending always rebuilds the email from the current lines and checks the fingerprint.
For a vendor with automatic sending enabled, the email leaves at its send slot without waiting for you. A preview that drifted is re-prepared first, unless you edited it by hand. A draft that fails the pre-send check, or a drifted preview you edited, is held back and you are notified by email. A draft whose send slot passed more than an hour ago is no longer sent automatically: it stays a draft and you send it by hand.
Automatic validation seals what nobody confirmed: supplier receptions and customer deliveries whose planned date is at least 12 hours in the past. Each seal records the same reception or delivery, with its stock movement, as the confirmation in the back office (see Write paths).
Density of the morning window (the 30-min and 3-h rhythm around the one-off passes):
The automatic validation grace period
A customer order's delivery date and a supplier order's expected reception date are planned dates, not proof that the delivery happened. Automatic validation therefore only seals what is old enough to have actually happened:
| Rule | Value | Effect |
|---|---|---|
| Grace period | 12 h | A reception or delivery only becomes eligible 12 h after its planned date. Validation can then run at any hour without sealing a delivery that has not happened yet. |
| Catch-up window | 12 days | Nothing older than 12 days is sealed automatically. |
On the reception side, eligible items are supplier orders sent or confirmed with no recorded reception, based on their expected reception date (or their send date when no reception date is set). On the delivery side, customer orders whose lines are not all delivered yet. In both cases the seal creates the same records (reception or delivery, plus the stock movement) as a manual confirmation, and can be undone the same way from the back office.
One exception: if the product was recounted (opening balance, inventory or manual stock correction) after the date of the reception or delivery, the seal still records the reception or delivery but writes no stock movement for that product. The count already contains the received units, or already excludes the delivered ones.
Automatic validation is a safety net, not the normal mode. The right gesture is to confirm the reception or validate the round when it happens, in the back office: the event is dated at the real time, and automatic validation has nothing left to assume.
Concrete scenarios
You correct a stock level at 10:00. The movement is recorded with its journal line, then the product's supplier drafts are recomputed within a minute. No need to wait for the 10:30 pass, which will only confirm the state.
A customer order arrives just before or just after a validation pass. No difference for ordering: the real-time recalculation handles it within about thirty seconds. Automatic validation does not touch a new order, whose delivery date is in the future. The only thing that changes is which pass will seal the delivery if it is forgotten, a shift of 2 h at most.
A delivery is planned for today at 09:00. The expected gesture is the seal on return: the order's delivery button or "Validate today's round". If nobody does it, the delivery becomes eligible at 21:00 (09:00 + 12 h grace) and the 21:01 pass seals it.
Checking that automatic validation runs
On the Stock ledger page of the back office, the "Cron 5" chip answers two separate questions:
1. Did automatic validation run? This is the chip's headline, based on the time of its last run:
| Last run | Chip | Reading |
|---|---|---|
| 5 h ago or less | green | validation is running normally |
| 12 h ago or less | amber | several passes missed, keep an eye on it |
| more than 12 h ago, or no run recorded | red | validation has stopped, contact support |
2. Did it seal anything? As secondary information, "last activity" shows the age of the latest automatic seal, on the supplier-reception side (⇣) and the customer-delivery side (⇡).
The two are kept apart because a quiet week legitimately produces no seal: no activity does not mean validation has stopped. If the last-run time is unavailable, the chip falls back to the age of the last activity and says so in its popover.
See also
- Overview: the stock and ordering model on one page
- The stock ledger: the journal that holds authority
- Write paths: how each movement is recorded
- Supplier orders: event-driven ordering
- PrestaShop synchronization: 3-hourly syncs and real-time webhooks
- Back-office screens: the
/managescreens, including the Cron 5 chip - Safety nets: consistency checks
- Configuration: engine settings