{"name": "线索接收（webhook → 校验 → 写库 → 响应）", "nodes": [{"id": "webhook1", "name": "Webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 2, "position": [250, 300], "parameters": {"path": "lead-intake", "httpMethod": "POST", "responseMode": "responseNode"}}, {"id": "if1", "name": "校验必填字段", "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [450, 300], "parameters": {"conditions": {"options": {"caseSensitive": true, "leftValue": "", "typeValidation": "loose"}, "conditions": [{"id": "cond-email", "leftValue": "={{ $json.body.email }}", "rightValue": "", "operator": {"type": "string", "operation": "notEmpty", "singleValue": true}}], "combinator": "and"}, "options": {}}}, {"id": "set1", "name": "整理线索", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [650, 220], "parameters": {"mode": "manual", "assignments": {"assignments": [{"id": "a1", "name": "email", "value": "={{ $json.body.email }}", "type": "string"}, {"id": "a2", "name": "source", "value": "webhook", "type": "string"}]}, "options": {}}}, {"id": "http1", "name": "写入业务系统", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [850, 220], "parameters": {"url": "https://example.com/api/leads", "method": "POST", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ email: $json.email, source: $json.source }) }}", "options": {"timeout": 10000}}, "retryOnFail": true, "maxTries": 3}, {"id": "respond1", "name": "返回成功", "type": "n8n-nodes-base.respondToWebhook", "typeVersion": 1.4, "position": [1050, 220], "parameters": {"respondWith": "json", "responseBody": "={{ { ok: true, email: $json.email } }}"}}, {"id": "respond2", "name": "返回参数错误", "type": "n8n-nodes-base.respondToWebhook", "typeVersion": 1.4, "position": [650, 420], "parameters": {"respondWith": "text", "responseBody": "missing required field: email", "responseCode": 400}}], "connections": {"Webhook": {"main": [[{"node": "校验必填字段", "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}]]}}, "settings": {"executionOrder": "v1"}}
