{"product_id":"n8n-shopify-rfm-win-back-workflow-gpt-4o-klaviyo-whatsapp","title":"n8n Shopify RFM Win-Back Workflow: GPT-4o + Klaviyo + WhatsApp","description":"\u003ch3\u003eWin back Shopify customers every week—automatically segmented by RFM, written with GPT-4o, and delivered via Klaviyo + WhatsApp\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow pulls your last 24 months of Shopify orders every Monday, calculates RFM customer segments, generates segment-specific win-back offers using OpenAI (GPT-4o-mini), creates Shopify discount codes, syncs reachable customers into Klaviyo lists, and sends WhatsApp Business Cloud template messages—then posts a weekly performance report to Slack.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns on schedule:\u003c\/strong\u003e Executes every Monday at \u003cstrong\u003e10 AM\u003c\/strong\u003e using a cron trigger.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eBuilds RFM segments:\u003c\/strong\u003e Fetches Shopify orders via the \u003cstrong\u003eShopify Admin REST API\u003c\/strong\u003e, loads the previous week’s segments from \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e, and calculates \u003cstrong\u003erecency, frequency, and monetary\u003c\/strong\u003e scores.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAssigns win-back logic:\u003c\/strong\u003e Determines an \u003cstrong\u003eRFM segment\u003c\/strong\u003e per customer, marks a deterministic \u003cstrong\u003e10% holdout per segment\u003c\/strong\u003e, and computes basic segment statistics plus week-over-week movement.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGenerates offer copy and discounts:\u003c\/strong\u003e For each configured segment above a minimum size, uses \u003cstrong\u003eOpenAI (gpt-4o-mini)\u003c\/strong\u003e to draft email and WhatsApp offer copy, applies discount cap guardrails, and creates a segment-specific Shopify discount code via the \u003cstrong\u003eShopify Admin GraphQL API\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSyncs to Klaviyo:\u003c\/strong\u003e Bulk-imports non-holdout, \u003cstrong\u003eemail-consented\u003c\/strong\u003e customers into the matching \u003cstrong\u003eKlaviyo\u003c\/strong\u003e list, storing offer details as \u003cstrong\u003eprofile properties\u003c\/strong\u003e. Alerts on import failures in \u003cstrong\u003eSlack\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSends WhatsApp:\u003c\/strong\u003e Sends an \u003cstrong\u003eapproved WhatsApp template message\u003c\/strong\u003e, prioritized by segment and capped per day, logs send results to Google Sheets, and includes the holdout flag.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCloses the loop:\u003c\/strong\u003e Upserts the current week’s customer segments (including the offer code and holdout flag) back to \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eWeekly Shopify win-back campaigns for “at-risk” and “lost” customers.\u003c\/li\u003e\n  \u003cli\u003eAutomated RFM segmentation and discount-code management without manual spreadsheets.\u003c\/li\u003e\n  \u003cli\u003eCoordinated outreach across \u003cstrong\u003eKlaviyo\u003c\/strong\u003e and \u003cstrong\u003eWhatsApp\u003c\/strong\u003e with segment-specific messaging.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes\/tools:\u003c\/strong\u003e if, code, slack, sticky note, http request, google sheets\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations:\u003c\/strong\u003e Shopify Admin REST + GraphQL APIs, OpenAI (gpt-4o-mini), Klaviyo, WhatsApp Business Cloud, Slack, Google Sheets\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWorkflow output:\u003c\/strong\u003e Google Sheets win-back log + weekly alerts\/reporting\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46254509818035,"sku":"N8N-21271","price":36.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/U1s52eOhS5V0z90JY9m77_PHScHC5M.png?v=1792573571","url":"https:\/\/buyflowscripts.com\/products\/n8n-shopify-rfm-win-back-workflow-gpt-4o-klaviyo-whatsapp","provider":"N8N Commerce","version":"1.0","type":"link"}