Analyse des performances régionales
Ceci est unCRM, AI Summarizationworkflow d'automatisation du domainecontenant 17 nœuds.Utilise principalement des nœuds comme Set, Code, Gmail, GoogleSheets, McpClientTool. Utiliser Bright Data MCP et GPT-4o pour analyser les performances des zones de vente
- •Compte Google et informations d'identification Gmail API
- •Informations d'identification Google Sheets API
- •Clé API OpenAI
Nœuds utilisés (17)
{
"id": "LIOY5U6r4W8pmkrH",
"meta": {
"instanceId": "60046904b104f0f72b2629a9d88fe9f676be4035769f1f08dad1dd38a76b9480",
"templateCredsSetupCompleted": true
},
"name": "33 Analyze Territory Performance",
"tags": [],
"nodes": [
{
"id": "0568c8de-17a3-4a9b-a3d7-cf9a9e937888",
"name": "Vérification Hebdomadaire du Territoire",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
0,
0
],
"parameters": {
"rule": {
"interval": [
{
"field": "weeks",
"triggerAtDay": [
1
],
"triggerAtHour": 9
}
]
}
},
"typeVersion": 1.2
},
{
"id": "065eaed2-28b0-4866-8173-5ec742a40e47",
"name": "Préparer les Paramètres de Requête",
"type": "n8n-nodes-base.set",
"position": [
200,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "01dce1c2-299c-4def-a8d0-0194cae94ea2",
"name": "url",
"type": "string",
"value": "example.com"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "71435f74-f8bf-485e-b16e-0a9092dfdec7",
"name": "Exécuter l'Extracteur Bright Data",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
440,
0
],
"parameters": {
"text": "=From the following URL, extract fields the below fields.\n\nStore ID\nName\nAddress\nRegion\n\nURL: {{ $json.url }}",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2
},
{
"id": "26363bd7-51e1-4a01-a489-e16f4b877b52",
"name": "Envoyer un Email de Notification",
"type": "n8n-nodes-base.gmail",
"position": [
1040,
-240
],
"webhookId": "0c0b75ed-5603-4dd4-a38f-fdf95c10e71d",
"parameters": {
"sendTo": "shahkar.genai@gmail.com",
"message": "=Hello Team!\n\nThe Regional sales data has updated in the google sheets. So go and check it out fast.\n\nRegards,\nYour Name",
"options": {},
"subject": "Regional Sales data has updated",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"id": "AQDSl75AdzK3vmqJ",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "bf4afd69-2309-4aed-89d5-34c704812bc9",
"name": "Diviser les Magasins en Éléments",
"type": "n8n-nodes-base.code",
"position": [
1040,
0
],
"parameters": {
"jsCode": "// n8n Function Node\n// Purpose: Takes wrapped `output` array, returns each store as its own item\n\nconst results = [];\n\n// Grab the output array from first item\nconst stores = items[0].json.output;\n\n// Loop through each store\nfor (const store of stores) {\n results.push({ json: store });\n}\n\nreturn results;\n"
},
"typeVersion": 2
},
{
"id": "6c9ea046-2bc1-40e5-a95e-66a7afbc3bad",
"name": "Mettre à Jour la Feuille de Données Régionale",
"type": "n8n-nodes-base.googleSheets",
"position": [
1260,
0
],
"parameters": {
"columns": {
"value": {
"Region": "={{ $json.region }}",
"Address": "={{ $json.address }}",
"Store ID": "={{ $json.store_id }}",
"Store name": "={{ $json.store_name }}",
"Last updated": "={{ $json.last_updated }}",
"Estimated sales": "={{ $json.estimated_sales }}"
},
"schema": [
{
"id": "Store ID",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Store ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Store name",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Store name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Address",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Address",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Region",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Region",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Estimated sales",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Estimated sales",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Last updated",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Last updated",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/12hjlzSEhesN4r05t4Bq9w4ttEBzwXEmddDSJZ30N0tA/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "12hjlzSEhesN4r05t4Bq9w4ttEBzwXEmddDSJZ30N0tA",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/12hjlzSEhesN4r05t4Bq9w4ttEBzwXEmddDSJZ30N0tA/edit?usp=drivesdk",
"cachedResultName": "Store data"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "r2mDaisH6e9VkwHl",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "f4d0b4ea-5842-4730-8cf5-e6627ab54329",
"name": "Outil Bright Data MCP",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
580,
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": "d3e22591-7bc7-494d-b917-934a4ffe419a",
"name": "Gestionnaire de Prompt LLM",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
400,
280
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8sEyPDkC5p4w4Jha",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "f100c167-e28b-480a-87d5-6c143812a96a",
"name": "Note Adhésive",
"type": "n8n-nodes-base.stickyNote",
"position": [
-40,
-640
],
"parameters": {
"color": 6,
"width": 380,
"height": 820,
"content": "## ✅ **🔹 Section 1: Trigger & Prepare**\n\n**Nodes:**\n1️⃣ `Weekly Territory Check` *(Schedule Trigger)*\n2️⃣ `Prepare Request Params` *(Edit Fields)*\n\n**💡 What it does:**\n\n* ⏰ **Weekly Trigger**: The automation starts **automatically** on a set schedule — e.g., every Monday at 6 AM — so you don’t need to remember to run it.\n* 📝 **Prepare Request**: This step **sets up the input** — like choosing which regions to scrape, date filters, or any special parameters you want the scraper to use.\n\n**✨ Why it’s powerful for you:**\n\n* You never forget to update your data.\n* Anyone can **adjust input** (e.g., change region) **without touching the rest of the workflow**.\n* Perfect for **zero-code team edits**.\n\n---\n\n"
},
"typeVersion": 1
},
{
"id": "8548ff7c-748e-464c-87b4-39b1bd973bde",
"name": "Note Adhésive1",
"type": "n8n-nodes-base.stickyNote",
"position": [
420,
-1000
],
"parameters": {
"color": 3,
"width": 300,
"height": 1180,
"content": "## ✅ **🔹 Section 2: Smart Data Collection & Parsing**\n\n**Nodes:**\n3️⃣ `Run Bright Data Scraper` *(AI Agent)*\n— uses ⏬\n\n* `Bright Data MCP Tool` *(MCP Client)*\n* `LLM Prompt Handler` *(OpenAI Chat Model)*\n* `Fix/Format Scraper Output` *(Auto-fixing Output Parser)*\n* `Validation Assistant` *(OpenAI Chat Model1)*\n* `Final Output Formatter` *(Structured Output Parser)*\n\n**💡 What it does:**\n\n* 🤖 The **AI Agent** talks to the **Bright Data MCP Tool** to **scrape live data** from your target sites.\n* 🧠 The **LLM Prompt Handler** helps the AI figure out what pages to crawl, what data to look for, and how to handle tricky websites.\n* 🧹 The **Auto-fixer & Parsers** make sure your scraped data is always **clean JSON**, so you never get errors in the next steps.\n\n**✨ Why it’s powerful for you:**\n\n* This section handles all the **dirty work** of web scraping & fixing messy data.\n* You **don’t write code or worry about site changes** — the agent + model fix issues automatically.\n* If a page changes, the AI adjusts how it scrapes, so you’re not stuck fixing broken scrapers every week.\n\n---\n"
},
"typeVersion": 1
},
{
"id": "17a66823-bde6-4205-b1e4-3c6cd1969f2b",
"name": "Note Adhésive2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1000,
-780
],
"parameters": {
"color": 5,
"width": 400,
"height": 960,
"content": "## ✅ **🔹 Section 3: Process, Save & Notify**\n\n**Nodes:**\n4️⃣ `Split Stores to Items` *(Code)*\n5️⃣ `Update Regional Data Sheet` *(Google Sheets)*\n6️⃣ `Send Notification Email` *(Gmail)*\n\n**💡 What it does:**\n\n* ⚙️ The `Split Stores to Items` node **unwraps** the single big output from the scraper → breaks it into **one item per store** so you can work with them individually.\n* 📊 The `Update Regional Data Sheet` node **writes each store’s info** into Google Sheets — creating a clean, always-up-to-date record of all your stores & their sales.\n* 📧 The `Send Notification Email` node **alerts you automatically** if anything needs attention — for example, “Hey, Region North has 20% higher load than Region South. Reassign recommended!”\n\n"
},
"typeVersion": 1
},
{
"id": "666629f1-e070-49f3-a31b-1c6375c75734",
"name": "Note Adhésive5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1480,
-780
],
"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": "f4e125ba-f6df-465d-8ce0-b0a6c996f3e0",
"name": "Note Adhésive9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1680,
-640
],
"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": "ec9115e3-3507-44e6-b57c-37e5fe7ed046",
"name": "Note Adhésive4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1680,
-300
],
"parameters": {
"color": 4,
"width": 1289,
"height": 2398,
"content": "## 🎯 **Your Workflow: Territory Performance Analyzer & Reassigner**\n\n**✨ Purpose:**\nEvery week, this automation **scrapes fresh regional sales data**, splits it cleanly, saves it to a tracking sheet, and sends a smart email update if anything needs your attention — **all without you doing a thing!**\n\n---\n\n## ✅ **🔹 Section 1: Trigger & Prepare**\n\n**Nodes:**\n1️⃣ `Weekly Territory Check` *(Schedule Trigger)*\n2️⃣ `Prepare Request Params` *(Edit Fields)*\n\n**💡 What it does:**\n\n* ⏰ **Weekly Trigger**: The automation starts **automatically** on a set schedule — e.g., every Monday at 6 AM — so you don’t need to remember to run it.\n* 📝 **Prepare Request**: This step **sets up the input** — like choosing which regions to scrape, date filters, or any special parameters you want the scraper to use.\n\n**✨ Why it’s powerful for you:**\n\n* You never forget to update your data.\n* Anyone can **adjust input** (e.g., change region) **without touching the rest of the workflow**.\n* Perfect for **zero-code team edits**.\n\n---\n\n## ✅ **🔹 Section 2: Smart Data Collection & Parsing**\n\n**Nodes:**\n3️⃣ `Run Bright Data Scraper` *(AI Agent)*\n— uses ⏬\n\n* `Bright Data MCP Tool` *(MCP Client)*\n* `LLM Prompt Handler` *(OpenAI Chat Model)*\n* `Fix/Format Scraper Output` *(Auto-fixing Output Parser)*\n* `Validation Assistant` *(OpenAI Chat Model1)*\n* `Final Output Formatter` *(Structured Output Parser)*\n\n**💡 What it does:**\n\n* 🤖 The **AI Agent** talks to the **Bright Data MCP Tool** to **scrape live data** from your target sites.\n* 🧠 The **LLM Prompt Handler** helps the AI figure out what pages to crawl, what data to look for, and how to handle tricky websites.\n* 🧹 The **Auto-fixer & Parsers** make sure your scraped data is always **clean JSON**, so you never get errors in the next steps.\n\n**✨ Why it’s powerful for you:**\n\n* This section handles all the **dirty work** of web scraping & fixing messy data.\n* You **don’t write code or worry about site changes** — the agent + model fix issues automatically.\n* If a page changes, the AI adjusts how it scrapes, so you’re not stuck fixing broken scrapers every week.\n\n---\n\n## ✅ **🔹 Section 3: Process, Save & Notify**\n\n**Nodes:**\n4️⃣ `Split Stores to Items` *(Code)*\n5️⃣ `Update Regional Data Sheet` *(Google Sheets)*\n6️⃣ `Send Notification Email` *(Gmail)*\n\n**💡 What it does:**\n\n* ⚙️ The `Split Stores to Items` node **unwraps** the single big output from the scraper → breaks it into **one item per store** so you can work with them individually.\n* 📊 The `Update Regional Data Sheet` node **writes each store’s info** into Google Sheets — creating a clean, always-up-to-date record of all your stores & their sales.\n* 📧 The `Send Notification Email` node **alerts you automatically** if anything needs attention — for example, “Hey, Region North has 20% higher load than Region South. Reassign recommended!”\n\n**✨ Why it’s powerful for you:**\n\n* You get **fresh, structured data** to review any time.\n* No manual copy/paste → your team sees **live performance trends**.\n* Automated emails keep your sales leads or managers in the loop without extra work.\n\n---\n\n## 🎉 **🔑 How a Beginner Can Use This**\n\n✅ **No coding:** Everything runs with prebuilt nodes.\n✅ **Flexible:** Change your schedule, filters, or regions without breaking the flow.\n✅ **Scalable:** Easily add more stores, new regions, or extra tools — e.g., auto-publish to Airtable or a dashboard.\n✅ **Fully Automated:** Wake up Monday → check your sheet → know exactly where to adjust territories.\n\n---\n\n## ✅ **🌟 Visual Summary with Icons**\n\n| Section | Steps | Icon |\n| ---------------------- | -------------------------------------------------- | -------- |\n| **1️⃣ Trigger & Prep** | 🕒 Weekly schedule → 📝 set scrape parameters | ⏰ ✏️ |\n| **2️⃣ Collect & Fix** | 🤖 AI scrapes → 🧠 LLM helps → 🧹 Fix bad data | 🤖 🧠 🧹 |\n| **3️⃣ Process & Act** | 🔗 Split items → 📊 Save to Sheets → 📧 Send email | ⚙️ 📊 📧 |\n\n---\n\n## 🗂️ **Result:**\n\n**Zero-hassle, fully automated territory management**, designed for **non-coders**, **sales ops**, or any small business owner.\n\n---\n\n"
},
"typeVersion": 1
},
{
"id": "8d32a7e9-423f-4c22-8356-d59302e9afd5",
"name": "Analyseur de Sortie Auto-corrigeant",
"type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
"position": [
720,
280
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "02d03b02-4186-4c9a-aa7c-dd9a0eddf39c",
"name": "Modèle de Chat OpenAI",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
700,
500
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8sEyPDkC5p4w4Jha",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "85bbb951-75ca-48ba-bd56-9763b0d8bd58",
"name": "Analyseur de Sortie Structurée1",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
860,
500
],
"parameters": {
"jsonSchemaExample": "[\n {\n \"store_id\": \"ST-101\",\n \"store_name\": \"SuperMart Downtown\",\n \"address\": \"123 Main St, Springfield\",\n \"region\": \"North Region\",\n \"estimated_sales\": 125000,\n \"last_updated\": \"2025-07-09\"\n },\n {\n \"store_id\": \"ST-102\",\n \"store_name\": \"SuperMart East Side\",\n \"address\": \"456 Maple Ave, Springfield\",\n \"region\": \"North Region\",\n \"estimated_sales\": 98000,\n \"last_updated\": \"2025-07-09\"\n },\n {\n \"store_id\": \"ST-103\",\n \"store_name\": \"SuperMart Riverside\",\n \"address\": \"789 River Rd, Rivertown\",\n \"region\": \"South Region\",\n \"estimated_sales\": 73000,\n \"last_updated\": \"2025-07-09\"\n },\n {\n \"store_id\": \"ST-104\",\n \"store_name\": \"SuperMart Uptown\",\n \"address\": \"321 Oak St, Rivertown\",\n \"region\": \"South Region\",\n \"estimated_sales\": 67000,\n \"last_updated\": \"2025-07-09\"\n },\n {\n \"store_id\": \"ST-105\",\n \"store_name\": \"SuperMart West End\",\n \"address\": \"555 Elm St, Lake City\",\n \"region\": \"West Region\",\n \"estimated_sales\": 115000,\n \"last_updated\": \"2025-07-09\"\n }\n]\n"
},
"typeVersion": 1.2
}
],
"active": false,
"pinData": {
"Run Bright Data Scraper": [
{
"json": {
"output": [
{
"region": "North Region",
"address": "123 Main St, Springfield",
"store_id": "ST-101",
"store_name": "SuperMart Downtown",
"last_updated": "2025-07-09",
"estimated_sales": 125000
},
{
"region": "North Region",
"address": "456 Maple Ave, Springfield",
"store_id": "ST-102",
"store_name": "SuperMart East Side",
"last_updated": "2025-07-09",
"estimated_sales": 98000
},
{
"region": "South Region",
"address": "789 River Rd, Rivertown",
"store_id": "ST-103",
"store_name": "SuperMart Riverside",
"last_updated": "2025-07-09",
"estimated_sales": 73000
},
{
"region": "South Region",
"address": "321 Oak St, Rivertown",
"store_id": "ST-104",
"store_name": "SuperMart Uptown",
"last_updated": "2025-07-09",
"estimated_sales": 67000
},
{
"region": "West Region",
"address": "555 Elm St, Lake City",
"store_id": "ST-105",
"store_name": "SuperMart West End",
"last_updated": "2025-07-09",
"estimated_sales": 115000
}
]
}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "e5410ef0-2611-442f-894a-4ebf7ab5ba3d",
"connections": {
"02d03b02-4186-4c9a-aa7c-dd9a0eddf39c": {
"ai_languageModel": [
[
{
"node": "8d32a7e9-423f-4c22-8356-d59302e9afd5",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"d3e22591-7bc7-494d-b917-934a4ffe419a": {
"ai_languageModel": [
[
{
"node": "71435f74-f8bf-485e-b16e-0a9092dfdec7",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"f4d0b4ea-5842-4730-8cf5-e6627ab54329": {
"ai_tool": [
[
{
"node": "71435f74-f8bf-485e-b16e-0a9092dfdec7",
"type": "ai_tool",
"index": 0
}
]
]
},
"bf4afd69-2309-4aed-89d5-34c704812bc9": {
"main": [
[
{
"node": "6c9ea046-2bc1-40e5-a95e-66a7afbc3bad",
"type": "main",
"index": 0
}
]
]
},
"065eaed2-28b0-4866-8173-5ec742a40e47": {
"main": [
[
{
"node": "71435f74-f8bf-485e-b16e-0a9092dfdec7",
"type": "main",
"index": 0
}
]
]
},
"0568c8de-17a3-4a9b-a3d7-cf9a9e937888": {
"main": [
[
{
"node": "065eaed2-28b0-4866-8173-5ec742a40e47",
"type": "main",
"index": 0
}
]
]
},
"71435f74-f8bf-485e-b16e-0a9092dfdec7": {
"main": [
[
{
"node": "bf4afd69-2309-4aed-89d5-34c704812bc9",
"type": "main",
"index": 0
},
{
"node": "26363bd7-51e1-4a01-a489-e16f4b877b52",
"type": "main",
"index": 0
}
]
]
},
"8d32a7e9-423f-4c22-8356-d59302e9afd5": {
"ai_outputParser": [
[
{
"node": "71435f74-f8bf-485e-b16e-0a9092dfdec7",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"85bbb951-75ca-48ba-bd56-9763b0d8bd58": {
"ai_outputParser": [
[
{
"node": "8d32a7e9-423f-4c22-8356-d59302e9afd5",
"type": "ai_outputParser",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Avancé - CRM, Résumé IA
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
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
Partager ce workflow