23 顧客生涯価値(CLV)を分析する
上級
これはMarket Research, AI Summarization分野の自動化ワークフローで、20個のノードを含みます。主にIf, Set, Code, Gmail, McpClientToolなどのノードを使用。 Bright Data MCPを使ってGPT-4で高値顧客を分析し、特定する
前提条件
- •Googleアカウント + Gmail API認証情報
- •OpenAI API Key
使用ノード (20)
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "wIBHF1QNYzvZZHta",
"meta": {
"instanceId": "60046904b104f0f72b2629a9d88fe9f676be4035769f1f08dad1dd38a76b9480",
"templateCredsSetupCompleted": true
},
"name": "23 Analyze Customer Lifetime Value",
"tags": [],
"nodes": [
{
"id": "a73dd3f9-4d76-46ba-b4bc-9c7035109825",
"name": "月次オファーキャンペーン実行",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
0,
0
],
"parameters": {
"rule": {
"interval": [
{
"field": "months",
"triggerAtHour": 9
}
]
}
},
"typeVersion": 1.2
},
{
"id": "8b11a03a-71da-4d82-8891-084adcddfd77",
"name": "顧客履歴URL設定",
"type": "n8n-nodes-base.set",
"position": [
200,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b366b00a-ad35-46ab-9722-6478ded6ec91",
"name": "customer data url",
"type": "string",
"value": "example.com"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "b1f84ba5-90f9-4483-968e-67df657a1936",
"name": "顧客プロファイル&注文履歴収集(エージェント)",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
480,
0
],
"parameters": {
"text": "=scrape the customer history url below and extract the key information:\n{{ $json['customer data url'] }}",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2
},
{
"id": "5aced094-ac88-4033-8a9b-dfc7b1457a6d",
"name": "Bright Data MCP Scraper",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
640,
280
],
"parameters": {
"toolName": "scrape_as_markdown",
"operation": "executeTool",
"toolParameters": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Tool_Parameters', ``, 'json') }}"
},
"credentials": {
"mcpClientApi": {
"id": "eqq94k789oJCd6jU",
"name": "MCP Client (STDIO) account"
}
},
"typeVersion": 1
},
{
"id": "ef9b75c8-1ec6-43ca-9969-909146214422",
"name": "AIアシスタント",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
440,
280
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8sEyPDkC5p4w4Jha",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "2d7909b4-333c-46cc-9909-5df7fe9bdeb6",
"name": "顧客情報フォーマット",
"type": "n8n-nodes-base.code",
"position": [
900,
0
],
"parameters": {
"jsCode": "// Get the array inside the 'output' key\nconst customers = items[0].json.output;\n\n// Map each customer to a separate item\nreturn customers.map(customer => {\n return { json: customer };\n});\n"
},
"typeVersion": 2
},
{
"id": "8d562c3e-2e0c-4ba8-8dbe-a89a23ba913b",
"name": "顧客注文履歴取得",
"type": "n8n-nodes-base.code",
"position": [
1100,
0
],
"parameters": {
"jsCode": "// Loop through all incoming customers\nconst output = [];\n\nfor (const item of items) {\n const customerName = item.json.customer_name;\n const customerEmail = item.json.customer_email; // Added email extraction\n const orders = item.json.orders;\n\n for (const order of orders) {\n output.push({\n json: {\n customer_name: customerName,\n customer_email: customerEmail, // Added email in output\n amount: order.amount,\n date: order.date\n }\n });\n }\n}\n\nreturn output;\n"
},
"typeVersion": 2
},
{
"id": "02a09456-b359-4989-99b5-c830e9d6ca2a",
"name": "高価値顧客判定",
"type": "n8n-nodes-base.if",
"position": [
1360,
0
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "6725053f-eae9-422c-942d-c82279482697",
"operator": {
"type": "number",
"operation": "gte"
},
"leftValue": "={{ $json.amount }}",
"rightValue": 200
}
]
}
},
"typeVersion": 2.2
},
{
"id": "9a0b0647-1341-4159-b639-5b3581548d74",
"name": "特別オファーメール送信",
"type": "n8n-nodes-base.gmail",
"position": [
1580,
-100
],
"webhookId": "f2c94a4c-06f0-43a0-81db-8c728ef0de2f",
"parameters": {
"sendTo": "={{ $json.customer_email }}",
"message": "write any offer",
"options": {},
"subject": "Offer for being out ideal customer"
},
"credentials": {
"gmailOAuth2": {
"id": "AQDSl75AdzK3vmqJ",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "3d73fb01-ab20-4be2-97c7-c21d5c95b45f",
"name": "低価値顧客無視",
"type": "n8n-nodes-base.noOp",
"position": [
1580,
100
],
"parameters": {},
"typeVersion": 1
},
{
"id": "7f81c4d2-d406-4d58-956e-78bca5a8f861",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
-40,
-1020
],
"parameters": {
"color": 2,
"width": 400,
"height": 1200,
"content": "## 🔁 **Section 1: Schedule & Input Setup**\n\n### 🧱 Nodes:\n\n* **🕒 `Run Offer Campaign Daily`**\n* **✏️ `Set Admin Dashboard URL`**\n\n### 📖 What Happens Here:\n\nThis section **initiates the workflow on a regular schedule** (daily, weekly, etc.). It also **sets the URL** of the **admin dashboard** where your customer data is stored.\n\n💡 **Beginner Tip:**\nThis is your starting point. You don't need to manually run the workflow every time — just schedule it, and it will run automatically using the trigger.\n\n✅ **Why it’s useful:**\nYou can run this process daily or weekly to find customers who deserve promotional offers, all on autopilot!\n\n---\n\n"
},
"typeVersion": 1
},
{
"id": "de0d7ee1-b627-4f17-b03e-4076b09166a9",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
440,
-900
],
"parameters": {
"color": 3,
"width": 340,
"height": 1080,
"content": "## 🤖 **Section 2: Scraping Customer Data with Agent**\n\n### 🧱 Nodes:\n\n* **🤖 `Scrape Customer Profiles & Orders (Agent)`**\n\n * ⚙️ **`AI Assistant (OpenAI Chat Model)`**\n * 🌐 **`Bright Data MCP Scraper`**\n * 🧾 **`Format Agent Output (Structured Output Parser)`**\n\n### 📖 What Happens Here:\n\nThe **AI Agent** (powered by OpenAI and Bright Data MCP) accesses your dashboard and scrapes:\n\n* 📇 **Customer profiles**\n* 🛒 **Their purchase/order history**\n\nThe **Structured Output Parser** then **cleans up and organizes** this data into a format that other nodes can use.\n\n💡 **Beginner Tip:**\nThis is like a smart assistant that goes to your admin dashboard, collects important info, and makes sure it’s readable for the next steps.\n\n✅ **Why it’s useful:**\nEven if the data is messy or complex on the dashboard, this section makes sure it’s clean and ready to use in your automation.\n\n---\n\n"
},
"typeVersion": 1
},
{
"id": "9f5db009-9461-4937-8c88-d55bf47bfe2c",
"name": "付箋2",
"type": "n8n-nodes-base.stickyNote",
"position": [
860,
-760
],
"parameters": {
"color": 5,
"width": 360,
"height": 940,
"content": "## 🧩 **Section 3: Data Formatting & Order Extraction**\n\n### 🧱 Nodes:\n\n* **🔧 `Format Customer Info`**\n* **📦 `Get Customer Order History`**\n\n### 📖 What Happens Here:\n\nThese function nodes further **organize and process the scraped data**:\n\n* The first node extracts key customer details like name, email, and ID.\n* The second node focuses on their **order data** — how many items they bought, total amount spent, etc.\n\n💡 **Beginner Tip:**\nThink of this as organizing data into two folders: 🧍♂️ “Customer Info” and 📊 “Purchase Data”.\n\n✅ **Why it’s useful:**\nClean separation of data means better targeting. You'll know exactly **who** bought **what**, and **how much** they spent — perfect for personalized offers!\n\n---\n\n"
},
"typeVersion": 1
},
{
"id": "a46e5710-fb85-46d6-addd-211994597386",
"name": "付箋3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1320,
-740
],
"parameters": {
"color": 6,
"width": 380,
"height": 1000,
"content": "## 🎯 **Section 4: Offer Decision & Action**\n\n### 🧱 Nodes:\n\n* **💰 `Is Customer High-Value?`**\n* **📧 `Send Special Offer Email`**\n* **➡️ `Ignore Low-Value Customers`**\n\n### 📖 What Happens Here:\n\nThis section **decides what action to take**:\n\n* The \"High Value Check\" compares a customer’s total spending against a fixed threshold.\n* If their spending is **high enough**, they get a personalized **offer email** via Gmail.\n* If not, they’re simply **skipped** — no email is sent.\n\n💡 **Beginner Tip:**\nYou don’t want to send offers to everyone. This smart filter ensures **only loyal/high-value customers** get incentives.\n\n"
},
"typeVersion": 1
},
{
"id": "e32fb60f-390a-4f16-9b81-6b82fda08328",
"name": "付箋5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1820,
-740
],
"parameters": {
"color": 7,
"width": 380,
"height": 240,
"content": "## I’ll receive a tiny commission if you join Bright Data through this link—thanks for fueling more free content!\n\n### https://get.brightdata.com/1tndi4600b25"
},
"typeVersion": 1
},
{
"id": "a31f7eec-c104-4631-86f3-523e68aab57b",
"name": "付箋9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1780,
-1040
],
"parameters": {
"color": 4,
"width": 1300,
"height": 320,
"content": "=======================================\n WORKFLOW ASSISTANCE\n=======================================\nFor any questions or support, please contact:\n Yaron@nofluff.online\n\nExplore more tips and tutorials here:\n - YouTube: https://www.youtube.com/@YaronBeen/videos\n - LinkedIn: https://www.linkedin.com/in/yaronbeen/\n=======================================\n"
},
"typeVersion": 1
},
{
"id": "0f4db4d3-102f-4c2c-a456-42bd14e95a76",
"name": "付箋4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1780,
-700
],
"parameters": {
"color": 4,
"width": 1289,
"height": 2758,
"content": "# 🎯 **Automated High-Value Customer Targeting & Offer Campaign**\n\n### *Smartly scrape, segment, and send personalized offers — all without lifting a finger.*\n\n---\n\n## 🔁 **Section 1: Schedule & Input Setup**\n\n### 🧱 Nodes:\n\n* **🕒 `Run Offer Campaign Daily`**\n* **✏️ `Set Admin Dashboard URL`**\n\n### 📖 What Happens Here:\n\nThis section **initiates the workflow on a regular schedule** (daily, weekly, etc.). It also **sets the URL** of the **admin dashboard** where your customer data is stored.\n\n💡 **Beginner Tip:**\nThis is your starting point. You don't need to manually run the workflow every time — just schedule it, and it will run automatically using the trigger.\n\n✅ **Why it’s useful:**\nYou can run this process daily or weekly to find customers who deserve promotional offers, all on autopilot!\n\n---\n\n## 🤖 **Section 2: Scraping Customer Data with Agent**\n\n### 🧱 Nodes:\n\n* **🤖 `Scrape Customer Profiles & Orders (Agent)`**\n\n * ⚙️ **`AI Assistant (OpenAI Chat Model)`**\n * 🌐 **`Bright Data MCP Scraper`**\n * 🧾 **`Format Agent Output (Structured Output Parser)`**\n\n### 📖 What Happens Here:\n\nThe **AI Agent** (powered by OpenAI and Bright Data MCP) accesses your dashboard and scrapes:\n\n* 📇 **Customer profiles**\n* 🛒 **Their purchase/order history**\n\nThe **Structured Output Parser** then **cleans up and organizes** this data into a format that other nodes can use.\n\n💡 **Beginner Tip:**\nThis is like a smart assistant that goes to your admin dashboard, collects important info, and makes sure it’s readable for the next steps.\n\n✅ **Why it’s useful:**\nEven if the data is messy or complex on the dashboard, this section makes sure it’s clean and ready to use in your automation.\n\n---\n\n## 🧩 **Section 3: Data Formatting & Order Extraction**\n\n### 🧱 Nodes:\n\n* **🔧 `Format Customer Info`**\n* **📦 `Get Customer Order History`**\n\n### 📖 What Happens Here:\n\nThese function nodes further **organize and process the scraped data**:\n\n* The first node extracts key customer details like name, email, and ID.\n* The second node focuses on their **order data** — how many items they bought, total amount spent, etc.\n\n💡 **Beginner Tip:**\nThink of this as organizing data into two folders: 🧍♂️ “Customer Info” and 📊 “Purchase Data”.\n\n✅ **Why it’s useful:**\nClean separation of data means better targeting. You'll know exactly **who** bought **what**, and **how much** they spent — perfect for personalized offers!\n\n---\n\n## 🎯 **Section 4: Offer Decision & Action**\n\n### 🧱 Nodes:\n\n* **💰 `Is Customer High-Value?`**\n* **📧 `Send Special Offer Email`**\n* **➡️ `Ignore Low-Value Customers`**\n\n### 📖 What Happens Here:\n\nThis section **decides what action to take**:\n\n* The \"High Value Check\" compares a customer’s total spending against a fixed threshold.\n* If their spending is **high enough**, they get a personalized **offer email** via Gmail.\n* If not, they’re simply **skipped** — no email is sent.\n\n💡 **Beginner Tip:**\nYou don’t want to send offers to everyone. This smart filter ensures **only loyal/high-value customers** get incentives.\n\n✅ **Why it’s useful:**\nIt automates your **customer segmentation** and **email marketing**, saving you time while targeting the right people to boost sales.\n\n---\n\n## 🎉 Final Thoughts\n\nThis workflow is a **powerful marketing automation tool**. Here's what it empowers you to do:\n\n* ⏰ Run promotions on autopilot\n* 🧠 Use AI and proxies to collect data\n* 🧹 Organize complex customer records\n* 🎯 Only target the most valuable users\n* 📈 Increase conversion rates with personalized emails\n\n---\n\n"
},
"typeVersion": 1
},
{
"id": "e7eec1fb-1a84-44be-8b8c-ab6fa4acbc1c",
"name": "Auto-fixing Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
"position": [
780,
280
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "3e4a7bfa-5ba6-4abb-8dac-72eeee8263a4",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
760,
500
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8sEyPDkC5p4w4Jha",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "6ba75ee7-46ea-4388-b5c2-b5ab2d4aecc1",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
920,
500
],
"parameters": {
"jsonSchemaExample": "[\n {\n \"customer_name\": \"John Doe\",\n \"orders\": [\n {\n \"amount\": 120,\n \"date\": \"2024-05-10\"\n },\n {\n \"amount\": 80,\n \"date\": \"2024-06-15\"\n }\n ]\n },\n {\n \"customer_name\": \"Jane Smith\",\n \"orders\": [\n {\n \"amount\": 200,\n \"date\": \"2024-04-05\"\n },\n {\n \"amount\": 150,\n \"date\": \"2024-05-01\"\n },\n {\n \"amount\": 180,\n \"date\": \"2024-06-10\"\n }\n ]\n },\n {\n \"customer_name\": \"Michael Johnson\",\n \"orders\": [\n {\n \"amount\": 600,\n \"date\": \"2024-07-01\"\n }\n ]\n }\n]\n"
},
"typeVersion": 1.2
}
],
"active": false,
"pinData": {
"Scrape Customer Profiles & Orders (Agent)": [
{
"json": {
"output": [
{
"orders": [
{
"date": "2024-05-10",
"amount": 120
},
{
"date": "2024-06-15",
"amount": 80
}
],
"customer_name": "John Doe",
"customer_email": "johndoe@gmail.com"
},
{
"orders": [
{
"date": "2024-04-05",
"amount": 200
},
{
"date": "2024-05-01",
"amount": 150
},
{
"date": "2024-06-10",
"amount": 180
}
],
"customer_name": "Jane Smith",
"customer_email": "johnsmith@gmail.com"
},
{
"orders": [
{
"date": "2024-07-01",
"amount": 600
}
],
"customer_name": "Michael Johnson",
"customer_email": "michael@gmail.com"
}
]
}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "f2ffb3ba-6efc-493d-93c6-6a2e99e8c2d8",
"connections": {
"ef9b75c8-1ec6-43ca-9969-909146214422": {
"ai_languageModel": [
[
{
"node": "b1f84ba5-90f9-4483-968e-67df657a1936",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"3e4a7bfa-5ba6-4abb-8dac-72eeee8263a4": {
"ai_languageModel": [
[
{
"node": "e7eec1fb-1a84-44be-8b8c-ab6fa4acbc1c",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"2d7909b4-333c-46cc-9909-5df7fe9bdeb6": {
"main": [
[
{
"node": "8d562c3e-2e0c-4ba8-8dbe-a89a23ba913b",
"type": "main",
"index": 0
}
]
]
},
"5aced094-ac88-4033-8a9b-dfc7b1457a6d": {
"ai_tool": [
[
{
"node": "b1f84ba5-90f9-4483-968e-67df657a1936",
"type": "ai_tool",
"index": 0
}
]
]
},
"02a09456-b359-4989-99b5-c830e9d6ca2a": {
"main": [
[
{
"node": "9a0b0647-1341-4159-b639-5b3581548d74",
"type": "main",
"index": 0
}
],
[
{
"node": "3d73fb01-ab20-4be2-97c7-c21d5c95b45f",
"type": "main",
"index": 0
}
]
]
},
"8b11a03a-71da-4d82-8891-084adcddfd77": {
"main": [
[
{
"node": "b1f84ba5-90f9-4483-968e-67df657a1936",
"type": "main",
"index": 0
}
]
]
},
"6ba75ee7-46ea-4388-b5c2-b5ab2d4aecc1": {
"ai_outputParser": [
[
{
"node": "e7eec1fb-1a84-44be-8b8c-ab6fa4acbc1c",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"e7eec1fb-1a84-44be-8b8c-ab6fa4acbc1c": {
"ai_outputParser": [
[
{
"node": "b1f84ba5-90f9-4483-968e-67df657a1936",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"8d562c3e-2e0c-4ba8-8dbe-a89a23ba913b": {
"main": [
[
{
"node": "02a09456-b359-4989-99b5-c830e9d6ca2a",
"type": "main",
"index": 0
}
]
]
},
"a73dd3f9-4d76-46ba-b4bc-9c7035109825": {
"main": [
[
{
"node": "8b11a03a-71da-4d82-8891-084adcddfd77",
"type": "main",
"index": 0
}
]
]
},
"b1f84ba5-90f9-4483-968e-67df657a1936": {
"main": [
[
{
"node": "2d7909b4-333c-46cc-9909-5df7fe9bdeb6",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
上級 - 市場調査, AI要約
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
競合サイトの更新状況を4つ追跡
Bright Data MCPとOpenAIを使用した自動のな競合価格モニタリング
If
Set
Google Sheets
+
If
Set
Google Sheets
18 ノードYaron Been
市場調査
16 競合企業価格を監視
Bright Data MCP と Google Sheets に基づく自動化された競合他社の価格設定モニタリング
Set
Code
Gmail
+
Set
Code
Gmail
18 ノードYaron Been
市場調査
競合製品リリースモニタリング
Bright DataとOpenAIに基づく即時のな競合製品リリース監視、メール/テーブルへの送信
Set
Code
Gmail
+
Set
Code
Gmail
18 ノードYaron Been
市場調査
10 メールマーケティングキャンペーンの成果を追跡
Bright Data と OpenAI を使ってメールマーケティング活動の分析とスマートフォローアップを自動化
If
Set
Gmail
+
If
Set
Gmail
17 ノードYaron Been
ソーシャルメディア
17 在庫レベルを追跡する
Amazon在庫レベル追跡の自動化、Bright Data MCPおよびOpenAIを使用
If
Set
Gmail
+
If
Set
Gmail
17 ノードYaron Been
エンジニアリング
13 トレンドテーマを識別
Bright Data MCP、GPTの分析、Trello統合でトレンドテーマを発見する
Set
Code
Trello
+
Set
Code
Trello
16 ノードYaron Been
市場調査
ワークフロー情報
難易度
上級
ノード数20
カテゴリー2
ノードタイプ12
作成者
Yaron Been
@yaron-nofluffBuilding AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host If you need any help with Automations, feel free to reach out via linkedin: https://www.linkedin.com/in/yaronbeen/ And check out my Youtube channel: https://www.youtube.com/@YaronBeen/videos
外部リンク
n8n.ioで表示 →
このワークフローを共有