{
  "name": "Predict customer churn daily using ML or LLM models and notify via Slack/email",
  "nodes": [
    {
      "id": "1f854286-b67a-42f9-9711-0056c93f9a0d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -384
      ],
      "parameters": {
        "width": 900,
        "height": 1504,
        "content": "## AI Customer Churn Predictor\n\nAnalyzes user behavior data and predicts churn probability using machine learning algorithms.\n\n## How it works\n\n1. **Trigger** — Runs daily at 2 AM to analyze active cu"
      }
    },
    {
      "id": "2ae5a72b-8d07-4274-8d1d-233863fb9a08",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        928,
        112
      ],
      "parameters": {
        "width": 500,
        "height": 768,
        "content": "## 1. Trigger & Collect Data\n\nDaily schedule to fetch customer profiles and behavioral data"
      }
    },
    {
      "id": "43bb8c82-df36-49f3-89fe-70d908cd5e4a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        256
      ],
      "parameters": {
        "width": 388,
        "height": 448,
        "content": "## 2. Feature Engineering\n\nExtract and calculate behavioral features for ML model"
      }
    },
    {
      "id": "45eec6c4-bb3c-40ae-91fd-f3523ced9e7b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        320
      ],
      "parameters": {
        "width": 596,
        "height": 408,
        "content": "## 3. ML Prediction\n\nRun churn probability predictions and score customers"
      }
    },
    {
      "id": "a0bd3b99-1e56-4d62-9abb-b60829950996",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2592,
        192
      ],
      "parameters": {
        "width": 550,
        "height": 612,
        "content": "## 4. Classify & Remediate\n\nRoute customers by risk level and create retention campaigns"
      }
    },
    {
      "id": "197eba11-4fc5-477a-9ec7-73b512f5351c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3232,
        208
      ],
      "parameters": {
        "width": 550,
        "height": 580,
        "content": "## 5. Report & Notify\n\nStore results and deliver churn analytics to stakeholders"
      }
    },
    {
      "id": "e6ec0958-1d51-45be-a2d3-e9e2edf6b9da",
      "name": "Daily churn analysis at 2 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1056,
        496
      ]
    },
    {
      "id": "4c3ff3c6-e6a4-4a16-8a9d-ce732dbccdc3",
      "name": "Fetch active customer profiles",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1280,
        304
      ]
    },
    {
      "id": "ca121dcf-1812-463d-8388-10266013e886",
      "name": "Fetch customer activity logs (30 days)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1280,
        496
      ]
    },
    {
      "id": "ed96d0b9-b6e3-408d-b955-2c3cf2080712",
      "name": "Fetch transaction history (90 days)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1280,
        688
      ]
    },
    {
      "id": "5ac08f4f-5321-40ad-81a1-f027fd635970",
      "name": "Merge customer and activity data",
      "type": "n8n-nodes-base.merge",
      "position": [
        1504,
        496
      ]
    },
    {
      "id": "39030266-1388-4a8f-8b10-4bb70898b93e",
      "name": "Engineer behavioral features",
      "type": "n8n-nodes-base.code",
      "position": [
        1728,
        496
      ]
    },
    {
      "id": "a6e2a4e3-05e5-426f-b6e6-8502ea446f3d",
      "name": "Call ML churn prediction model",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1952,
        496
      ]
    },
    {
      "id": "241db3b1-befb-4b8e-9758-f84ae5d600c8",
      "name": "Score and classify churn risk",
      "type": "n8n-nodes-base.code",
      "position": [
        2176,
        496
      ]
    },
    {
      "id": "e37bc7ba-bd03-41d3-9be4-0744bbb5b2d7",
      "name": "Route by risk level",
      "type": "n8n-nodes-base.switch",
      "position": [
        2400,
        480
      ]
    },
    {
      "id": "c276d68c-d114-4894-a2c1-7b7a2f620762",
      "name": "Create retention campaign task",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2624,
        400
      ]
    },
    {
      "id": "ca4e1fe7-be3f-4551-88f2-321fee4b8318",
      "name": "Store churn predictions in database",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2624,
        592
      ]
    },
    {
      "id": "77b5a3e0-50ac-4a7a-90fd-5df6a4245a73",
      "name": "Generate churn analytics report",
      "type": "n8n-nodes-base.code",
      "position": [
        2848,
        496
      ]
    },
    {
      "id": "749cee1c-71ed-4c46-acf5-2bffb16fd094",
      "name": "Filter at-risk customers",
      "type": "n8n-nodes-base.filter",
      "position": [
        3072,
        496
      ]
    },
    {
      "id": "859e2c70-dded-45ee-a8a0-118a16762657",
      "name": "Post churn alert to Slack",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3296,
        400
      ]
    },
    {
      "id": "c871536b-fb9f-4b73-ba8e-9666959da6ab",
      "name": "Email report to customer success team",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        3296,
        592
      ]
    },
    {
      "id": "f6b94a2d-c388-4596-9438-f8b593307b22",
      "name": "Log analysis completion",
      "type": "n8n-nodes-base.code",
      "position": [
        3520,
        496
      ]
    }
  ],
  "connections": {
    "Route by risk level": {
      "main": [
        [
          {
            "node": "Create retention campaign task",
            "type": "main",
            "index": 0
          },
          {
            "node": "Store churn predictions in database",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create retention campaign task",
            "type": "main",
            "index": 0
          },
          {
            "node": "Store churn predictions in database",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Store churn predictions in database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter at-risk customers": {
      "main": [
        [
          {
            "node": "Post churn alert to Slack",
            "type": "main",
            "index": 0
          },
          {
            "node": "Email report to customer success team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post churn alert to Slack": {
      "main": [
        [
          {
            "node": "Log analysis completion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily churn analysis at 2 AM": {
      "main": [
        [
          {
            "node": "Fetch active customer profiles",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch customer activity logs (30 days)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch transaction history (90 days)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Engineer behavioral features": {
      "main": [
        [
          {
            "node": "Call ML churn prediction model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Score and classify churn risk": {
      "main": [
        [
          {
            "node": "Route by risk level",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call ML churn prediction model": {
      "main": [
        [
          {
            "node": "Score and classify churn risk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create retention campaign task": {
      "main": [
        [
          {
            "node": "Generate churn analytics report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch active customer profiles": {
      "main": [
        [
          {
            "node": "Merge customer and activity data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate churn analytics report": {
      "main": [
        [
          {
            "node": "Filter at-risk customers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge customer and activity data": {
      "main": [
        [
          {
            "node": "Engineer behavioral features",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch transaction history (90 days)": {
      "main": [
        [
          {
            "node": "Merge customer and activity data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Store churn predictions in database": {
      "main": [
        [
          {
            "node": "Generate churn analytics report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email report to customer success team": {
      "main": [
        [
          {
            "node": "Log analysis completion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch customer activity logs (30 days)": {
      "main": [
        [
          {
            "node": "Merge customer and activity data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}