The Predictive Replenishment Engine
Naturavest (Health & Wellness E-Commerce)
An event-driven WhatsApp retention engine that pre-computes product depletion dates at checkout and triggers hyper-personalized, 2-step re-engagement sequences via Meta WABA.

The Challenge
Our Solution
System Architecture & Deep Dive
1. The "Pre-Compute" Math Engine (The Innovation)
2. The Daily Oracle (Lightning-Fast Delivery)
3. The Two-Step Psychological Sequence
4. Hyper-Dynamic Media at Scale
Technical Architecture (No SaaS Bloat)
The Business Impact
Passive Revenue Loop
Naturavest now has a 24/7 automated system that passively recovers revenue by catching customers right before they churn.
Zero Operational Friction
The Naturavest team never has to manually export CSVs, check dates, or send texts. The system is entirely invisible to them.
Infinite Scalability
Whether they have 4 products or 4,000, the system automatically fetches the correct images, links, and lifespans. They never have to touch the automation as they scale.
The Technology Stack
We engineered this solution using a decoupled, API-first architecture. By separating the logic engine from the data source and the messaging gateway, we built a system that is infinitely scalable, highly secure, and completely free of recurring SaaS middleware fees.
Data Source & State Management: Shopify Admin API
Utilized Custom Metafields to store product lifespans and calculated reminder dates directly on the Shopify order, leveraging Shopify as our system of record. Used Order Tags and Webhooks for real-time event triggering.
Backend Logic & Orchestration: n8n (Cloud-Hosted on DigitalOcean)
Replaced expensive, restrictive tools like Zapier with an open-source automation engine hosted on dedicated cloud infrastructure. Executed complex JavaScript (Node.js) for date arithmetic, string manipulation (regex), and JSON payload transformation.
API Communication Layer: GraphQL & REST
Fetching daily reminders via highly optimized GraphQL queries (filtering by tags to reduce API load). Safely appending and removing order tags via GraphQL Mutations (tagsAdd / tagsRemove) to prevent destructive REST API overwrites.
Messaging Gateway & Compliance: WhatsApp Business API (WABA) via Messaging.digital
Navigated strict Meta anti-spam compliance to design and deploy dynamic, pre-approved Message Templates. Orchestrated complex JSON payloads featuring dynamic image headers, variable body text, and 1-tap URL buttons.
Infrastructure & DevOps: DigitalOcean Droplet, Docker, Nginx
Deployed the automation engine on a secure DigitalOcean cloud VPS with SSL encryption, ensuring 24/7 uptime, high availability, and secure webhook transmission for just $5/month.
