Skip to main content

Score Shopify customer churn risk and sync results to Klaviyo, Slack, and Gmail

Workflow preview

Workflow preview
100%
Score Shopify customer churn risk and sync results to Klaviyo, Slack, and Gmail preview
Open on n8n.io

1. Workflow Overview

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 customer...

Best for

  • CRM automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.slack, n8n-nodes-base.httprequest, n8n-nodes-base.gmail, n8n-nodes-base.merge, n8n-nodes-base.converttofile

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Tricore Infotech Pvt Ltd.

Original n8n.io source

1.1 Workflow description

Title
Score Shopify customer churn risk and sync results to Klaviyo, Slack, and Gmail
Workflow name
Score Shopify customer churn risk and sync results to Klaviyo, Slack, and Gmail

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 and/or Gmail.

How it works

  1. Runs weekly on a schedule and loads your Shopify domain, thresholds, and toggles for Klaviyo, Slack, and Gmail alerts.
  2. Queries the Shopify Admin GraphQL API in pages of 100 customers filtered by minimum order count and an order-date window that excludes very recent purchasers.
  3. Calculates each customer’s median days between recent orders, computes days since last order, and labels customers as MEDIUM or HIGH risk based on the days-since-last vs. median interval ratio.
  4. Stores at-risk customers across pagination and continues fetching until Shopify reports there are no more pages.
  5. Retrieves the full at-risk customer list, clears stored data for the next run, and stops if no at-risk customers are found.
  6. If enabled, updates each at-risk customer profile in Klaviyo by writing churn_risk and days_since_last_order via the Klaviyo API.
  7. Generates a dated CSV of at-risk customers, aggregates counts and revenue-at-risk totals, and sends the summary with the CSV attached to Slack and/or Gmail.

Setup

  1. Add Shopify Admin API credentials (Header Auth) and set your shopifyDomain value in the workflow configuration.
  2. Add a Klaviyo Private API key (HTTP Header Auth) if you want to sync profile properties to Klaviyo.
  3. Connect your Gmail OAuth2 credential and set the recipient email address if you want email alerts.
  4. Connect your Slack credential and set the target Slack channel ID if you want Slack alerts and error notifications.
  5. In the workflow configuration, enable or disable emailAlert, slackAlert, and klaviyoEvent, and adjust minimumOrderRequired, customerActiveDays, and safeDays to match your store’s buying cycles.

Requirements

  • Shopify store with Admin API access (GraphQL endpoint).
  • Klaviyo account for profile updates.
  • Slack workspace and Gmail account for reporting.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky — Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky — Trigger and Config

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky — Paginated Fetch

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky — Retrieve Results

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky — Klaviyo Updates

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky — Build Report

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky — Email Alert

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky — Slack Alert

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Calculate Churn Risk

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - If Alerts Enabled

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 11 - If Risky Customers Found

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 12 - If Batch Has Risky Customers

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 13 - If Email Notifications On

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 14 - If Slack Notifications On

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 15 - Send CSV to Slack Channel

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 16 - If Klaviyo Enabled

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 17 - Send to Klaviyo API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.4

Block 18 - Send Email Alert

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 19 - Combine Export Data

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 20 - Aggregate Churn Results

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 21 - Create CSV Export

Type / Role
n8n-nodes-base.convertToFile - convertToFile
Config choices
Version 1.1

Block 22 - Check for Next Page

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 23 - Save Batch to Memory

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 24 - Set Workflow Config

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Showing the first 24 of 31 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Score Shopify customer churn risk and sync results to Klaviyo, Slack, and Gmail
Complexity advanced
Nodes 31
Categories CRM, AI Summarization
Author Tricore Infotech Pvt Ltd
Published 29 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16013/16013.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Score Shopify customer churn risk and sync results to Klaviyo, Slack, and Gmail do?

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 customer...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your CRM, AI Summarization use case.