Start with the operating contract
Define the trigger, source record, destination, mapping, expected completion time and owner. For inventory, decide which system owns available quantity. For orders, define when an order becomes eligible, how cancellations are handled and which identifier connects records across systems.
Separate transport from business rules
Fetching data, validating it and applying a commercial rule are different concerns. Keeping them separate makes exceptions easier to inspect and avoids mixing an API outage with a rejected business condition.
Design for duplicates and missed events
Shopify notes that webhook ordering is not guaranteed, recommends deduplicating with the webhook ID and advises periodic reconciliation because deliveries can be missed. A reliable workflow therefore stores event identifiers, processes updates idempotently and rechecks source data on a schedule.
Make failure visible
Record the input, outcome, timestamp and retry state. Retry transient failures with limits and backoff; route permanent validation errors to review. A successful HTTP request is not always a successful business operation, so inspect response bodies and downstream state.
Delivery checklist
1. Name the source of truth. 2. Define stable identifiers. 3. Validate before writing. 4. Make retries idempotent. 5. Add alerts and ownership. 6. Reconcile source and destination. 7. Test recovery from downtime.
