Score Shopify customer churn risk and sync results to Klaviyo, Slack, and Gmail
Ready for 3.0What this workflow does
This workflow has 22 nodes and runs on a schedule (every week at 07:00) (plus 1 other trigger). Along the way it connects Slack, Gmail and GraphQL. It also calls a.klaviyo.com over HTTP.
How it runs
Trigger: On a schedule (every week at 07:00) (plus 1 other trigger).
- Set Workflow Config (Edit Fields (Set)): sets 9 fields: shopifyDomain, emailAlert, recipientMail…
- Post Error to Slack (Slack): uses Slack
- If: checks a condition and branches into true / false
- Fetch Customer Data (GraphQL): uses GraphQL
- Calculate Churn Risk (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- Save Batch to Memory (Code): runs custom JavaScript code
- Check for Next Page (If): checks a condition and branches into true / false
- Limit: keeps the first few items
- Retrieve Customer Data (Code): runs custom JavaScript code
…plus 10 more steps. See the full node list below.
Services it uses
Other Gmail + Slack templates (957)
HTTP calls to: a.klaviyo.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (12)
- Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Slack
n8n-nodes-base.slack - HTTP Request
n8n-nodes-base.httpRequest - Gmail
n8n-nodes-base.gmail - Merge
n8n-nodes-base.merge - Convert to File
n8n-nodes-base.convertToFile - Edit Fields (Set)
n8n-nodes-base.set - Schedule Trigger
n8n-nodes-base.scheduleTrigger - GraphQL
n8n-nodes-base.graphql - Error Trigger
n8n-nodes-base.errorTrigger - Limit
n8n-nodes-base.limit
From the author
Quick overview This workflow runs weekly to fetch customers from the Shopify Admin GraphQL API, calculate churn risk based on each customer’s median reorder interval, and then sync at-risk customers to Klaviyo while sending a CSV report and summary to Slack…