{
  "name": "Automate customer retention with AI risk prediction, Stripe coupons & personalized Gmail",
  "nodes": [
    {
      "id": "c6be714c-7c14-4390-a237-fbb53776b807",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 636,
        "height": 568,
        "content": "# 📉 Churn Risk Prediction & Retention Automation\n\nThis workflow acts as an intelligent retention system by connecting your data, AI, and communication channels. It proactively identifies at-risk custo"
      }
    },
    {
      "id": "362566c2-b855-4e8e-b587-9df91232ebd4",
      "name": "Schedule Trigger - 毎日03:00実行",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        864,
        784
      ]
    },
    {
      "id": "fefc8b12-23ce-42b4-a5f8-5c2bcdc3a885",
      "name": "Note - Schedule",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        512
      ],
      "parameters": {
        "width": 1114,
        "height": 564,
        "content": "## 1️⃣ Data Aggregation\nCombines data from multiple sources to build a 360° customer profile.\n- **CRM**: Basic info & billing status.\n- **Support**: Ticket volume & sentiment.\n- **Postgres**: Product "
      }
    },
    {
      "id": "8afa0a02-5798-4c7b-9d63-80b4cb53ff2a",
      "name": "対象顧客リスト取得 (CRM)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1088,
        784
      ]
    },
    {
      "id": "3675add7-bcd4-40d6-aa98-24378fad8614",
      "name": "サポートチケット情報取得",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1312,
        784
      ]
    },
    {
      "id": "c3cf6f1a-0f2f-4bfc-ab1e-7d5eca3c8139",
      "name": "サポート指標集計",
      "type": "n8n-nodes-base.code",
      "position": [
        1536,
        784
      ]
    },
    {
      "id": "76c16aed-d85f-4238-b42d-94172be38718",
      "name": "製品利用ログ取得",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1760,
        880
      ]
    },
    {
      "id": "2c0fda3b-345e-4a5f-8003-1193e0ad8100",
      "name": "データ統合 (CRM+サポート)",
      "type": "n8n-nodes-base.merge",
      "position": [
        1760,
        688
      ]
    },
    {
      "id": "0597dc99-a10b-4314-aa91-b958f71dd59c",
      "name": "データ統合 (全データ)",
      "type": "n8n-nodes-base.merge",
      "position": [
        1984,
        784
      ]
    },
    {
      "id": "de98a118-193f-4367-8d79-643cb1f7c9f0",
      "name": "AI解約リスク予測",
      "type": "n8n-nodes-base.openAi",
      "position": [
        2208,
        784
      ]
    },
    {
      "id": "c2fac4bf-2a58-4428-8396-425e12143ba1",
      "name": "高リスク顧客フィルタ",
      "type": "n8n-nodes-base.if",
      "position": [
        2432,
        784
      ]
    },
    {
      "id": "8f582aa8-f7b0-44d5-bab3-c568d92273ab",
      "name": "特別オファー生成",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2656,
        688
      ]
    },
    {
      "id": "c0c9b403-9f18-4a23-bead-43545b633379",
      "name": "オファー内容決定",
      "type": "n8n-nodes-base.code",
      "position": [
        2880,
        688
      ]
    },
    {
      "id": "61b76572-c497-493e-b08d-b127a0cd9afd",
      "name": "リテンションメール生成",
      "type": "n8n-nodes-base.openAi",
      "position": [
        3104,
        688
      ]
    },
    {
      "id": "43fb7ea5-bae2-40ee-be1c-788113aa8437",
      "name": "リテンションメール送信",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3328,
        688
      ]
    },
    {
      "id": "ff37bbde-5d0e-447a-b0d2-5da483d8bc68",
      "name": "施策ログ保存",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3552,
        688
      ]
    },
    {
      "id": "468ea94d-69f8-4e39-ab8f-61d793fab544",
      "name": "未更新ログ取得",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2656,
        880
      ]
    },
    {
      "id": "09bdea50-c62f-4c8f-9752-b76e4b78ef32",
      "name": "メール開封状況取得",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2880,
        880
      ]
    },
    {
      "id": "d64e0cf7-1324-4797-adcb-00b664bdaec1",
      "name": "開封データ処理",
      "type": "n8n-nodes-base.code",
      "position": [
        3104,
        880
      ]
    },
    {
      "id": "6fc33072-8a3e-4608-b6a7-1b96a35b50da",
      "name": "効果測定データ更新",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3328,
        880
      ]
    },
    {
      "id": "fb362f24-190f-43a4-93d2-a1dad8675e71",
      "name": "30日経過レコード取得",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3552,
        880
      ]
    },
    {
      "id": "3d7735d3-93f4-4b78-a502-0df3e9ba76eb",
      "name": "顧客ステータス確認",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3776,
        880
      ]
    },
    {
      "id": "d962495a-3066-47b6-b842-39c852c01fd1",
      "name": "継続状況判定",
      "type": "n8n-nodes-base.code",
      "position": [
        4000,
        880
      ]
    },
    {
      "id": "8def677b-25fb-4c06-9bae-58638da7cfda",
      "name": "最終結果更新",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4224,
        880
      ]
    },
    {
      "id": "2601c627-89f7-4925-b5c6-f3af17d94f35",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2160,
        528
      ],
      "parameters": {
        "width": 432,
        "height": 464,
        "content": "## 2️⃣ AI Risk Analysis\nOpenAI analyzes the aggregated data to predict the likelihood of churn (0.0 - 1.0).\n- **Filter**: Only customers with a risk score **> 0.7** proceed to the retention flow."
      }
    },
    {
      "id": "b5da0a9d-d20c-4dae-91c3-36ab21a627b5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2640,
        512
      ],
      "parameters": {
        "width": 576,
        "height": 576,
        "content": "## 3️⃣ Personalized Retention Action\n- **Stripe**: Generates a unique coupon code (discount varies by MRR).\n- **OpenAI**: Drafts a highly personalized email based on the user's specific pain points.\n-"
      }
    },
    {
      "id": "78b48631-1c20-4385-8f6b-9cba6beb212a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3232,
        544
      ],
      "parameters": {
        "width": 1136,
        "height": 480,
        "content": "## 4️⃣ Campaign Tracking & Feedback Loop\nThis section measures the ROI of your retention efforts.\n- **Engagement**: Checks email open/click rates via SendGrid API.\n- **Outcome**: Verifies if the custo"
      }
    }
  ],
  "connections": {
    "継続状況判定": {
      "main": [
        [
          {
            "node": "最終結果更新",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "未更新ログ取得": {
      "main": [
        [
          {
            "node": "メール開封状況取得",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "開封データ処理": {
      "main": [
        [
          {
            "node": "効果測定データ更新",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI解約リスク予測": {
      "main": [
        [
          {
            "node": "高リスク顧客フィルタ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "オファー内容決定": {
      "main": [
        [
          {
            "node": "リテンションメール生成",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "サポート指標集計": {
      "main": [
        [
          {
            "node": "製品利用ログ取得",
            "type": "main",
            "index": 0
          },
          {
            "node": "データ統合 (CRM+サポート)",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "特別オファー生成": {
      "main": [
        [
          {
            "node": "オファー内容決定",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "製品利用ログ取得": {
      "main": [
        [
          {
            "node": "データ統合 (全データ)",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "メール開封状況取得": {
      "main": [
        [
          {
            "node": "開封データ処理",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "効果測定データ更新": {
      "main": [
        [
          {
            "node": "30日経過レコード取得",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "顧客ステータス確認": {
      "main": [
        [
          {
            "node": "継続状況判定",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "30日経過レコード取得": {
      "main": [
        [
          {
            "node": "顧客ステータス確認",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "データ統合 (全データ)": {
      "main": [
        [
          {
            "node": "AI解約リスク予測",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "高リスク顧客フィルタ": {
      "main": [
        [
          {
            "node": "特別オファー生成",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "未更新ログ取得",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "リテンションメール生成": {
      "main": [
        [
          {
            "node": "リテンションメール送信",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "リテンションメール送信": {
      "main": [
        [
          {
            "node": "施策ログ保存",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "対象顧客リスト取得 (CRM)": {
      "main": [
        [
          {
            "node": "サポートチケット情報取得",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "データ統合 (CRM+サポート)": {
      "main": [
        [
          {
            "node": "データ統合 (全データ)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger - 毎日03:00実行": {
      "main": [
        [
          {
            "node": "対象顧客リスト取得 (CRM)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "サポートチケット情報取得": {
      "main": [
        [
          {
            "node": "サポート指標集計",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}