{
  "name": "Score churn risk and send retention emails with Google Sheets and Gmail",
  "nodes": [
    {
      "id": "b5bcafdb-b1c7-4201-ab6c-2171119c2406",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "7bd64aea-da7f-4361-b43c-ac425488e199",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -1248
      ],
      "parameters": {
        "width": 736,
        "height": 912,
        "content": "## Who this template is for\n\nThis workflow is designed for gyms, fitness studios, and membership-based businesses that want to proactively reduce customer churn and improve retention.\n\nIt is ideal for"
      }
    },
    {
      "id": "936ef243-c2ab-4de2-998d-28b651754001",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -208
      ],
      "parameters": {
        "width": 400,
        "height": 416,
        "content": "## A. Member data intake\n\nThis section starts the workflow and loads the member records that will be evaluated.\n\nIn the demo version, the workflow is triggered manually. In a real production setup, th"
      }
    },
    {
      "id": "043fdf69-85ee-47a4-9ff2-a613daf2b38f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -208
      ],
      "parameters": {
        "width": 576,
        "height": 416,
        "content": "## B. Churn scoring engine\n\nThis is the decision-making core of the workflow.\n\nThe code node analyzes each member using predefined retention logic and assigns a churn risk score or category. This scor"
      }
    },
    {
      "id": "d5f0a028-95a8-40bc-a946-cbeb4ef2c2d9",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -400
      ],
      "parameters": {
        "width": 768,
        "height": 864,
        "content": "## C. Risk-based routing\n\nThis section uses the churn classification to route each member into the appropriate path.\n\nDepending on the assigned level, such as critical, high, medium, or low, the workf"
      }
    },
    {
      "id": "8f911082-4cfd-4537-99e3-8e317613b7d2",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -672
      ],
      "parameters": {
        "width": 544,
        "height": 336,
        "content": "## 📊 Sample Data Sheet\n\nTo use this template, make a copy of the sample Google Sheet below and connect it to the Google Sheets nodes:\n\n## 👉 [Click here to access the sample sheet](https://docs.google."
      }
    },
    {
      "id": "d11b3655-b5b0-41e4-829f-1870d33c1137",
      "name": "Fetch Member Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        208,
        0
      ]
    },
    {
      "id": "12187428-7256-4186-9831-8c3527210858",
      "name": "Calculate Churn Ris",
      "type": "n8n-nodes-base.code",
      "position": [
        416,
        0
      ]
    },
    {
      "id": "7352d46c-2974-4946-a22a-d715333eef53",
      "name": "Route by Risk Level",
      "type": "n8n-nodes-base.switch",
      "position": [
        624,
        -32
      ]
    },
    {
      "id": "4f149e8d-9746-4a0b-9c3b-43765e93b97d",
      "name": "Prepare Critical Alert",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        -176
      ]
    },
    {
      "id": "8ced6c40-82b9-4fd6-9d2b-eae34fec264b",
      "name": "Prepare High Risk Email",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        -16
      ]
    },
    {
      "id": "f70ab5c8-9d4c-4760-933c-77fbf2144fdb",
      "name": "Format Medium Risk Log",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        160
      ]
    },
    {
      "id": "be7241f5-c227-4114-b0ec-d17707e83570",
      "name": "Send Critical Notification",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1072,
        -176
      ]
    },
    {
      "id": "5c1991f9-ef4a-4819-8037-80fc1ec40948",
      "name": "Send Winback Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1072,
        -16
      ]
    },
    {
      "id": "4948c2b2-d760-4f2b-80a1-ddbbc90c3d75",
      "name": "Log Critical Action",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1280,
        -176
      ]
    },
    {
      "id": "21f5338b-3181-4211-b08d-d5e8fb3f0106",
      "name": "Log High Risk Action",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1296,
        -16
      ]
    },
    {
      "id": "18ed4309-7e19-4742-bd41-54a06a294b78",
      "name": "Log Medium Risk Member",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1104,
        160
      ]
    },
    {
      "id": "e2e32ccf-6582-410e-b4ac-6187e5d753cd",
      "name": "Ignore Low Risk",
      "type": "n8n-nodes-base.noOp",
      "position": [
        880,
        336
      ]
    }
  ],
  "connections": {
    "Fetch Member Data": {
      "main": [
        [
          {
            "node": "Calculate Churn Ris",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Winback Email": {
      "main": [
        [
          {
            "node": "Log High Risk Action",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Churn Ris": {
      "main": [
        [
          {
            "node": "Route by Risk Level",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Risk Level": {
      "main": [
        [
          {
            "node": "Prepare Critical Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare High Risk Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Medium Risk Log",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Ignore Low Risk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Medium Risk Log": {
      "main": [
        [
          {
            "node": "Log Medium Risk Member",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Critical Alert": {
      "main": [
        [
          {
            "node": "Send Critical Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare High Risk Email": {
      "main": [
        [
          {
            "node": "Send Winback Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Critical Notification": {
      "main": [
        [
          {
            "node": "Log Critical Action",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Fetch Member Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}