8
n8n 中文网amn8n.com

使用 BatchData 进行潜在客户资质审核

高级

这是一个Sales, AI领域的自动化工作流,包含 17 个节点。主要使用 If, Code, Slack, Webhook, HttpRequest 等节点,结合人工智能技术实现智能自动化。 使用 BatchData 的自动化房产潜在客户评分

前置要求
  • Slack Bot Token 或 Webhook URL
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "0uon02fOzPkLcG6G",
  "meta": {
    "instanceId": "bb9853d4d7d87207561a30bc6fe4ece20b295264f7d27d4a62215de2f3846a56",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 BatchData 进行潜在客户资质审核",
  "tags": [],
  "nodes": [
    {
      "id": "376bc838-013e-4033-a508-d27a2a64d792",
      "name": "CRM 新潜在客户 Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2560,
        600
      ],
      "webhookId": "8fb37aae-df12-40eb-81ea-0e5022e1f988",
      "parameters": {
        "path": "crm-new-lead",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "2ca36d9f-7682-4a08-9fff-1674b36e07e4",
      "name": "Webhook 设置说明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2720,
        160
      ],
      "parameters": {
        "color": 5,
        "width": 420,
        "height": 620,
        "content": "# WEBHOOK 设置说明"
      },
      "typeVersion": 1
    },
    {
      "id": "961b3c4c-5b58-439e-9c8c-cc6e9774ebe7",
      "name": "获取潜在客户数据",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2180,
        600
      ],
      "parameters": {
        "url": "={{ $json.crmApiUrl }}/leads/{{ $json.leadId }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.1
    },
    {
      "id": "3549918e-cea8-467e-90d0-3661a5f54ae9",
      "name": "CRM API 说明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2280,
        160
      ],
      "parameters": {
        "color": 5,
        "width": 300,
        "height": 620,
        "content": "# CRM API 配置"
      },
      "typeVersion": 1
    },
    {
      "id": "25445c3c-adf0-41d7-8f5f-c0fabc297658",
      "name": "BatchData 房产查询",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1840,
        600
      ],
      "parameters": {
        "url": "https://api.batchdata.com/api/v1/property/search",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "address",
              "value": "={{ $json.address }}"
            },
            {
              "name": "city",
              "value": "={{ $json.city }}"
            },
            {
              "name": "state",
              "value": "={{ $json.state }}"
            },
            {
              "name": "zipcode",
              "value": "={{ $json.zipcode }}"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.1
    },
    {
      "id": "85808ecf-e5b0-4d36-a2c3-66c26bb2a191",
      "name": "BatchData API 说明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1960,
        160
      ],
      "parameters": {
        "color": 5,
        "width": 360,
        "height": 620,
        "content": "# BATCHDATA API 设置"
      },
      "typeVersion": 1
    },
    {
      "id": "389e2f49-9ed4-4017-8002-ac86e1001ed9",
      "name": "评分与资质审核",
      "type": "n8n-nodes-base.code",
      "position": [
        -1480,
        620
      ],
      "parameters": {
        "jsCode": "// Initialize lead score\nlet score = 0;\nlet qualificationStatus = \"not qualified\";\nlet qualificationNotes = [];\n\n// Get property data from BatchData response\nconst propertyData = $input.first().json;\nconst leadData = $input.first().json;\n\n// Check if property exists\nif (propertyData.success === true && propertyData.data) {\n  const property = propertyData.data;\n  \n  // Score based on property value\n  if (property.estimatedValue > 750000) {\n    score += 30;\n    qualificationNotes.push(\"High-value property: $\" + property.estimatedValue);\n  } else if (property.estimatedValue > 500000) {\n    score += 20;\n    qualificationNotes.push(\"Mid-high value property: $\" + property.estimatedValue);\n  } else if (property.estimatedValue > 350000) {\n    score += 10;\n    qualificationNotes.push(\"Average value property: $\" + property.estimatedValue);\n  }\n  \n  // Score based on property size\n  if (property.squareFootage > 3000) {\n    score += 15;\n    qualificationNotes.push(\"Large property: \" + property.squareFootage + \" sq ft\");\n  } else if (property.squareFootage > 2000) {\n    score += 10;\n    qualificationNotes.push(\"Mid-size property: \" + property.squareFootage + \" sq ft\");\n  }\n  \n  // Score based on property age\n  const currentYear = new Date().getFullYear();\n  const propertyAge = currentYear - property.yearBuilt;\n  \n  if (propertyAge < 5) {\n    score += 15;\n    qualificationNotes.push(\"New construction: \" + property.yearBuilt);\n  } else if (propertyAge < 20) {\n    score += 10;\n    qualificationNotes.push(\"Relatively new property: \" + property.yearBuilt);\n  }\n  \n  // Other factors to consider\n  if (property.ownerOccupied === false) {\n    score += 15;\n    qualificationNotes.push(\"Investment property (not owner-occupied)\");\n  }\n  \n  if (property.lotSize > 0.5) {\n    score += 10;\n    qualificationNotes.push(\"Large lot size: \" + property.lotSize + \" acres\");\n  }\n  \n  // Determine qualification status based on score\n  if (score >= 50) {\n    qualificationStatus = \"high-value\";\n  } else if (score >= 30) {\n    qualificationStatus = \"qualified\";\n  } else if (score >= 15) {\n    qualificationStatus = \"potential\";\n  }\n  \n  // Combine all data for CRM update\n  const enrichedData = {\n    leadId: leadData.leadId,\n    score: score,\n    qualificationStatus: qualificationStatus,\n    qualificationNotes: qualificationNotes.join(\", \"),\n    propertyData: {\n      estimatedValue: property.estimatedValue,\n      squareFootage: property.squareFootage,\n      yearBuilt: property.yearBuilt,\n      lotSize: property.lotSize,\n      bedrooms: property.bedrooms,\n      bathrooms: property.bathrooms,\n      ownerOccupied: property.ownerOccupied,\n      lastSaleDate: property.lastSaleDate,\n      lastSalePrice: property.lastSalePrice\n    }\n  };\n  \n  return enrichedData;\n} else {\n  // If property data not found\n  qualificationNotes.push(\"Property data not found or verification failed\");\n  \n  return {\n    leadId: leadData.leadId,\n    score: 0,\n    qualificationStatus: \"unverified\",\n    qualificationNotes: qualificationNotes.join(\", \"),\n    propertyData: null\n  };\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "f33f6442-5e8b-4aab-b5ff-d37d062a5cfa",
      "name": "潜在客户评分说明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1580,
        -280
      ],
      "parameters": {
        "color": 3,
        "width": 320,
        "height": 1060,
        "content": "# 潜在客户评分算法"
      },
      "typeVersion": 1
    },
    {
      "id": "b9bcb2af-6ccc-4f9e-9926-765df4f36809",
      "name": "更新 CRM 潜在客户",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1120,
        620
      ],
      "parameters": {
        "url": "={{ $json.crmApiUrl }}/leads/{{ $json.leadId }}",
        "method": "PUT",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "score",
              "value": "={{ $json.score }}"
            },
            {
              "name": "qualificationStatus",
              "value": "={{ $json.qualificationStatus }}"
            },
            {
              "name": "qualificationNotes",
              "value": "={{ $json.qualificationNotes }}"
            },
            {
              "name": "propertyValue",
              "value": "={{ $json.propertyData.estimatedValue }}"
            },
            {
              "name": "squareFootage",
              "value": "={{ $json.propertyData.squareFootage }}"
            },
            {
              "name": "yearBuilt",
              "value": "={{ $json.propertyData.yearBuilt }}"
            },
            {
              "name": "bedrooms",
              "value": "={{ $json.propertyData.bedrooms }}"
            },
            {
              "name": "bathrooms",
              "value": "={{ $json.propertyData.bathrooms }}"
            },
            {
              "name": "batchDataVerified",
              "value": "={{ $json.propertyData !== null }}"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.1
    },
    {
      "id": "3cfa64f8-527a-49d5-9787-156fe084f37c",
      "name": "CRM 更新说明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1240,
        160
      ],
      "parameters": {
        "color": 5,
        "width": 340,
        "height": 620,
        "content": "# CRM 更新配置"
      },
      "typeVersion": 1
    },
    {
      "id": "8470bcf6-a539-4f75-8494-f76bcfc95f00",
      "name": "是否为高价值潜在客户?",
      "type": "n8n-nodes-base.if",
      "position": [
        -760,
        620
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.qualificationStatus }}",
              "value2": "high-value"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "da84ac21-fbb2-4640-8e92-f40b23d2fa0a",
      "name": "路由说明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        160
      ],
      "parameters": {
        "color": 3,
        "width": 320,
        "height": 620,
        "content": "# 路由逻辑"
      },
      "typeVersion": 1
    },
    {
      "id": "c7772695-cda1-4483-a961-7468fd075c55",
      "name": "创建即时跟进任务",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -180,
        320
      ],
      "parameters": {
        "url": "={{ $json.crmApiUrl }}/tasks",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "type",
              "value": "immediate-followup"
            },
            {
              "name": "leadId",
              "value": "={{ $json.leadId }}"
            },
            {
              "name": "priority",
              "value": "high"
            },
            {
              "name": "dueDate",
              "value": "={{ $now.format(\"YYYY-MM-DD\") }}"
            },
            {
              "name": "note",
              "value": "High-value lead with property value of ${{ $json.propertyData.estimatedValue }}. Immediate follow-up required."
            },
            {
              "name": "assignedTo",
              "value": "senior-agent"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.1
    },
    {
      "id": "2fd15500-7314-4910-b822-c3d9de4166df",
      "name": "跟进任务说明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        -140
      ],
      "parameters": {
        "color": 4,
        "width": 420,
        "height": 640,
        "content": "# 高价值潜在客户处理"
      },
      "typeVersion": 1
    },
    {
      "id": "0d0d4e2e-b040-45d1-8a4c-e775520a4bbc",
      "name": "发送 Slack 通知",
      "type": "n8n-nodes-base.slack",
      "position": [
        -60,
        860
      ],
      "webhookId": "dc308b09-6aea-41be-96c4-c322cfc8ed8f",
      "parameters": {
        "text": "=High-value lead alert: {{ $json.leadId }}\nProperty Value: ${{ $json.propertyData.estimatedValue }}\nScore: {{ $json.score }}\nQualification Notes: {{ $json.qualificationNotes }}",
        "select": "channel",
        "channelId": "high-value-leads",
        "otherOptions": {}
      },
      "typeVersion": 2
    },
    {
      "id": "de158d72-7472-4075-ba57-13916739d24b",
      "name": "通知说明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        520
      ],
      "parameters": {
        "color": 4,
        "width": 460,
        "height": 500,
        "content": "# 通知配置"
      },
      "typeVersion": 1
    },
    {
      "id": "1433b56d-3d8e-465a-bccc-c2dece4d6a1c",
      "name": "工作流概览",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3200,
        260
      ],
      "parameters": {
        "width": 400,
        "height": 400,
        "content": "# BatchData 潜在客户资质审核工作流"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d914c2d9-b2af-4c00-b5cd-7ed80d713cb0",
  "connections": {
    "Fetch Lead Data": {
      "main": [
        [
          {
            "node": "BatchData Property Lookup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update CRM Lead": {
      "main": [
        [
          {
            "node": "Is High-Value Lead?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is High-Value Lead?": {
      "main": [
        [
          {
            "node": "Create Immediate Follow-up Task",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Slack Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CRM New Lead Webhook": {
      "main": [
        [
          {
            "node": "Fetch Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Score And Qualify Lead": {
      "main": [
        [
          {
            "node": "Update CRM Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BatchData Property Lookup": {
      "main": [
        [
          {
            "node": "Score And Qualify Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 销售, 人工智能

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量17
分类2
节点类型6
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Preston Zeller

Preston Zeller

@zellerhaus

Growth strategist and technologist, seeing companies from $25MM to $300MM ARR. Building innovative solutions with AI, workflows, desktop and mobile applications.

外部链接
在 n8n.io 查看

分享此工作流