2-email sequence with cross-run state — stops automatically if customer converts between sends
The Problem
A DTC brand leaving abandoned cart revenue untouched daily. Klaviyo's pricing at their list size was $400/month — more than the projected recovery revenue for the first quarter. No existing system tracked whether a customer converted between recovery email attempts, risking sending a discount code to someone who already paid full price.
The Solution
Three decoupled workflows communicating exclusively via Postgres. A Trigger workflow captures Shopify checkout. abandoned events and immediately fires the Recovery workflow asynchronously (Execute Workflow with "wait" disabled). The Recovery workflow waits 1 hour, then re-reads the cart's status from Postgres before sending Email 1 — if status changed to "converted," execution stops. It waits another 23 hours and re-reads again before sending Email 2 with a discount code. Independently, an Order Placed workflow listens for Shopify order created and updates any matching cart record to "converted" — this is the signal the Recovery workflow checks. Google Sheets logs every conversion outcome.
Key Engineering
Result
→ Abandoned cart recovery automated at zero ongoing cost. Conversion detection confirmed working — second email suppressed correctly when test order placed between sends. Full recovery sequence operational for a fraction of Klaviyo's monthly fee.
Tech Stack
Shopify Trigger, Execute Workflow (Async), Wait Node, Postgres (Cross-run State), Gmail, Google Sheets



