An event-driven pipeline behind every email, reminder and profile update for a subscription brand.
The brand runs its customer messaging in Customer.io: order updates, pickup and replenishment reminders, referral and influencer emails, and subscription nudges. I built the layer that feeds it: dozens of small services that turn what happens in the store, subscriptions, deliveries and the referral program into clean events and profile updates.
Each service does one job and hands off through Pub/Sub. Every call to Customer.io goes through a single rate-limited Cloud Tasks queue, so a busy sale day queues up instead of hitting API limits, and delivery is guaranteed.
To keep costs down, Pub/Sub uses push subscriptions instead of pull. Pub/Sub calls each Cloud Run service only when an event arrives, so services scale to zero between events instead of running all day waiting for messages. The trade-off is Firestore TTL: it deletes expired documents within about 24 hours of the due time, not the moment they expire. For restock reminders that timing is fine, so the saving was worth it.
Every moment a customer should hear from the brand.
Order updates from checkout to doorstep, including pickup, refunds and cancellations.
Subscription moments: new, paused and cancelled plans, upcoming charges and payment problems.
Referral and creator emails, from a new referral to a payout.
A live sync of customer profiles that only sends what changed.
Reminders to restock, timed to when a product is likely to run out.
Pickup and unused-points reminders, plus transactional emails through a queued sender.
Two flows start in the database itself. When a customer record changes, or a reminder's time-to-live runs out, Firestore emits an event. Eventarc hands it to Pub/Sub, and a small service shapes it for Customer.io. Nothing polls and nothing runs on a timer.
