Light
Dark
All diagrams ← Backend Extension →
Candid Leap · WF-Algolia

Deep Dive — Sync Lifecycle & Reliability

Success
Failure & retry
Recovery & ops
How jobs startFive triggers, one pending job

Webhook

Publish events via the Cloudflare queue → POST /internal/sync-trigger.

Manual

Sync-now from the Designer extension.

Scheduled

Per-mapping cron — the hourly scheduler tick.

DLQ replay

Dead-letter messages re-posted every 5 minutes.

Force-reindex

Destructive rebuild. Needs a 5-min HS256 confirmation token from the cost-preview endpoint, plus a 5-min per-mapping cooldown.

HS256 tokendestructive
SyncJob state machinepending → in_progress → terminal

pending

Queued. A lockKey partial-unique index (status pending / in_progress) collapses duplicate triggers.

in_progress

Claimed atomically by the worker (findOneAndUpdate, 1.5 s poll); heartbeats while running.

completed

Terminal. Counters + lastSynced persisted.

failed → retry

attempts < 5: back to pending with backoff.

dead_letter

attempts = 5: parked, surfaced as needs-attention in the extension.

cancelled

Terminal, user-initiated.

Failure classification & signals

ErrorClass

7 values — webflow_4xx · webflow_5xx · algolia_4xx · algolia_5xx · timeout · validation · unknown. Attached to sync_failed PostHog events, not persisted on the job document.

PostHog events

sync_started · sync_completed · sync_failed · sync_cancelled · queue_dlq_landed.

Email alerts

Stale site · stale Algolia key · sync failures — 7-day per-alert cooldown.

Extension health

deriveHealth() maps job + mapping state to 7 RowHealth values: syncing · synced · stale · retrying · needs-attention · never-synced · not-mapped.

Two dead-letter layers — different things, same nameMessage-level vs job-level retry exhaustion

Edge: CF Queue DLQ

A message that failed delivery 5 times moves to webflow-sync-dlq; swept every 5 minutes back into POST /internal/sync-trigger.

App: SyncJob dead_letter

A job that failed processing 5 times parks as status dead_letter; recovered via manual sync or force-reindex.