N
n8n Store
Workflow Market
Lead Source Quality Analyzer

Lead Source Quality Analyzer

by rahul080 views

説明

Categories

⚙️ Automation

Nodes Used

n8n-nodes-base.ifn8n-nodes-base.slackn8n-nodes-base.slackn8n-nodes-base.functionn8n-nodes-base.highLeveln8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNote
Price無料
Views0
最終更新11/28/2025
workflow.json
{
  "id": "K9qVquFhgKL4K7Sy",
  "meta": {
    "instanceId": "8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177",
    "templateCredsSetupCompleted": true
  },
  "name": "Lead Source Quality Analyzer",
  "tags": [],
  "nodes": [
    {
      "id": "d4979a88-400d-4ce0-a27e-e0465b248e7e",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        32,
        608
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1a91fc6a-fa5b-4985-ae23-d9e02e2ad1dd",
      "name": "Sticky Note - Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        496
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "height": 280,
        "content": "## 📊 WORKFLOW START\n\nThis workflow analyzes lead source quality by:\n1. Fetching opportunities from HighLevel\n2. Filtering won deals\n3. Computing conversion metrics\n4. Sending reports to Slack and Google Sheets\n\n**Trigger:** Manual execution"
      },
      "typeVersion": 1
    },
    {
      "id": "8908da61-371e-4efe-986f-199ef3889a1a",
      "name": "Sticky Note - Fetch Data",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        304
      ],
      "parameters": {
        "color": 5,
        "width": 280,
        "height": 284,
        "content": "## 🎯 FETCH OPPORTUNITIES\n\nRetrieves all opportunities from HighLevel CRM.\n\nThis is the data source for the entire analysis.\n\n**Output:** List of all opportunities with status, amount, and lead source information."
      },
      "typeVersion": 1
    },
    {
      "id": "0cf6069e-5d6f-4337-b213-1931fb787104",
      "name": "Sticky Note - Filtering Logic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        768
      ],
      "parameters": {
        "color": 6,
        "width": 300,
        "height": 296,
        "content": "## ✅ FILTER WON DEALS\n\nSplits the workflow into two paths:\n\n**TRUE Path:** Opportunities with status = 'won'\n→ Goes to analysis and reporting\n\n**FALSE Path:** All other opportunities\n→ Sends individual notifications to Slack\n\nThis ensures only successful deals are analyzed for lead source quality."
      },
      "typeVersion": 1
    },
    {
      "id": "d751b397-2da7-468c-af32-c469485e9847",
      "name": "Sticky Note - Analytics",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        240
      ],
      "parameters": {
        "color": 7,
        "width": 520,
        "height": 240,
        "content": "## 📈 ANALYTICS PIPELINE\n\nProcesses won deals through:\n\n1. **Google Sheets:** Logs raw won deal data\n2. **Metrics Calculation:** Aggregates by lead source\n3. **Slack Report:** Sends summary to team\n\nThis pipeline provides both raw data storage and actionable insights."
      },
      "typeVersion": 1
    },
    {
      "id": "ba86138e-0226-401c-84c3-22ab9b9baecc",
      "name": "Sticky Note - Status Alerts",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        800
      ],
      "parameters": {
        "color": 3,
        "width": 280,
        "height": 268,
        "content": "## 🔔 NON-WON NOTIFICATION\n\nSends individual Slack messages for opportunities that are NOT won.\n\nUseful for tracking:\n- Lost opportunities\n- Pending deals\n- Other statuses requiring attention"
      },
      "typeVersion": 1
    },
    {
      "id": "48d32b33-0535-4cda-9f9b-aaf70d494950",
      "name": "Log Won Deals to Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        720,
        512
      ],
      "parameters": {
        "range": "Sheet1!A1:D1",
        "options": {},
        "sheetId": "<YOUR_GOOGLE_SHEET_ID>",
        "authentication": "oAuth2"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "s4dP1fNuVZ2gWvs3",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "66b4ddec-d5ed-47b7-8392-dc048b75f4cb",
      "name": "Calculate Lead Source Metrics",
      "type": "n8n-nodes-base.function",
      "position": [
        944,
        512
      ],
      "parameters": {
        "functionCode": "const sourceData = items.map(i => i.json);\nconst result = {};\n\nsourceData.forEach(deal => {\n  const source = deal.leadSource;\n  if (!result[source]) result[source] = { deals: 0, totalAmount: 0 };\n  result[source].deals += 1;\n  result[source].totalAmount += parseFloat(deal.amount || 0);\n});\n\nreturn [{ json: result }];"
      },
      "typeVersion": 1
    },
    {
      "id": "8f3105fb-6b5c-4882-8144-6cde4aadb837",
      "name": "Send Analytics to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1168,
        512
      ],
      "parameters": {
        "text": "={{JSON.stringify($json, null, 2)}}",
        "channel": "#lead-source-report",
        "attachments": [],
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "rNqvWj9TfChPVRYY",
          "name": "Slack account vivek"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c635333b-e2ff-403c-ad24-809d7ff7b2ac",
      "name": "Fetch All HighLevel Opportunities",
      "type": "n8n-nodes-base.highLevel",
      "position": [
        272,
        608
      ],
      "parameters": {
        "filters": {},
        "resource": "opportunity",
        "operation": "getAll",
        "returnAll": true,
        "requestOptions": {}
      },
      "credentials": {
        "highLevelOAuth2Api": {
          "id": "5QWHSi134dLIBEsC",
          "name": "HighLevel account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "bca4f587-dc3a-4979-9d80-8f172d6f888a",
      "name": "Check If Status = Won",
      "type": "n8n-nodes-base.if",
      "position": [
        496,
        608
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "101c298b-4c62-4273-9d25-bad055eff980",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "=won"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "5c2b45bc-4c6a-4263-b5a6-f56e796f7aee",
      "name": "Alert Non-Won Status to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        720,
        704
      ],
      "webhookId": "87d944e1-4d16-4154-bb7c-cb36637272df",
      "parameters": {
        "text": "=Opportuniy id: {{ $json.id }} is {{ $json.status }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09GNB90TED",
          "cachedResultName": "general-information"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "rNqvWj9TfChPVRYY",
          "name": "Slack account vivek"
        }
      },
      "typeVersion": 2.3
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0baa1992-9f7c-4c69-94bd-25d9fe883283",
  "connections": {
    "Check If Status = Won": {
      "main": [
        [
          {
            "node": "Log Won Deals to Sheets",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Alert Non-Won Status to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Won Deals to Sheets": {
      "main": [
        [
          {
            "node": "Calculate Lead Source Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Lead Source Metrics": {
      "main": [
        [
          {
            "node": "Send Analytics to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All HighLevel Opportunities": {
      "main": [
        [
          {
            "node": "Check If Status = Won",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Fetch All HighLevel Opportunities",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

相关工作流