{
  "name": "\u8868\u5355\u5904\u7406\u5de5\u4f5c\u6d41",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "form-submission",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-node",
      "name": "Webhook\u63a5\u6536\u5668",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// \u5904\u7406\u8868\u5355\u6570\u636e\nconst formData = $json;\n\n// \u6570\u636e\u9a8c\u8bc1\u548c\u6e05\u7406\nconst processedData = {\n  ...formData,\n  processedAt: new Date().toISOString(),\n  status: 'processed',\n  id: Math.random().toString(36).substr(2, 9)\n};\n\n// \u6839\u636e\u4f18\u5148\u7ea7\u8bbe\u7f6e\u5904\u7406\u7c7b\u578b\nswitch (formData.priority) {\n  case 'high':\n    processedData.processingType = 'urgent';\n    processedData.assignedTo = 'manager';\n    break;\n  case 'medium':\n    processedData.processingType = 'normal';\n    processedData.assignedTo = 'team';\n    break;\n  default:\n    processedData.processingType = 'standard';\n    processedData.assignedTo = 'system';\n}\n\n// \u6dfb\u52a0\u90e8\u95e8\u76f8\u5173\u5904\u7406\nif (formData.department) {\n  processedData.departmentCode = formData.department;\n  processedData.notificationEmail = `${formData.department.toLowerCase()}@company.com`;\n}\n\n// \u751f\u6210\u54cd\u5e94\u6d88\u606f\nprocessedData.responseMessage = `\u8868\u5355\u5df2\u6210\u529f\u5904\u7406\uff0c\u5904\u7406ID: ${processedData.id}`;\n\nconsole.log('\u5904\u7406\u540e\u7684\u6570\u636e:', processedData);\n\nreturn processedData;"
      },
      "id": "function-node",
      "name": "\u6570\u636e\u5904\u7406",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{$json.subscribe}}",
              "value2": true
            }
          ]
        }
      },
      "id": "if-node",
      "name": "\u68c0\u67e5\u8ba2\u9605\u72b6\u6001",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "subject": "\u8868\u5355\u5904\u7406\u901a\u77e5",
        "text": "\u60a8\u597d {{$json.name}}\uff0c\n\n\u60a8\u7684\u8868\u5355\u5df2\u6210\u529f\u63d0\u4ea4\u5e76\u5904\u7406\u3002\n\n\u5904\u7406\u8be6\u60c5\uff1a\n- \u5904\u7406ID: {{$json.id}}\n- \u5904\u7406\u65f6\u95f4: {{$json.processedAt}}\n- \u4f18\u5148\u7ea7: {{$json.priority}}\n- \u90e8\u95e8: {{$json.department}}\n- \u5206\u914d\u7ed9: {{$json.assignedTo}}\n\n\u5982\u6709\u7591\u95ee\uff0c\u8bf7\u8054\u7cfb\u76f8\u5173\u90e8\u95e8\u3002\n\n\u8c22\u8c22\uff01",
        "toEmail": "={{$json.email}}",
        "fromEmail": "noreply@company.com",
        "senderName": "\u81ea\u52a8\u5316\u7cfb\u7edf"
      },
      "id": "email-node",
      "name": "\u53d1\u9001\u90ae\u4ef6\u901a\u77e5",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        900,
        200
      ]
    },
    {
      "parameters": {
        "functionCode": "// \u8bb0\u5f55\u5904\u7406\u65e5\u5fd7\nconst logData = {\n  timestamp: new Date().toISOString(),\n  formId: $json.id,\n  name: $json.name,\n  email: $json.email,\n  department: $json.department,\n  priority: $json.priority,\n  processingType: $json.processingType,\n  assignedTo: $json.assignedTo,\n  emailSent: $json.subscribe,\n  logLevel: 'INFO',\n  message: '\u8868\u5355\u5904\u7406\u5b8c\u6210'\n};\n\nconsole.log('\u5904\u7406\u65e5\u5fd7:', logData);\n\n// \u8fd9\u91cc\u53ef\u4ee5\u53d1\u9001\u5230\u65e5\u5fd7\u7cfb\u7edf\u6216\u6570\u636e\u5e93\n// \u76ee\u524d\u53ea\u662f\u63a7\u5236\u53f0\u8f93\u51fa\n\nreturn logData;"
      },
      "id": "log-node",
      "name": "\u8bb0\u5f55\u65e5\u5fd7",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        900,
        400
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "{\n  \"success\": true,\n  \"message\": \"\u8868\u5355\u5904\u7406\u6210\u529f\",\n  \"data\": {\n    \"id\": \"{{$json.id}}\",\n    \"processedAt\": \"{{$json.processedAt}}\",\n    \"priority\": \"{{$json.priority}}\",\n    \"assignedTo\": \"{{$json.assignedTo}}\",\n    \"emailSent\": {{$json.subscribe}},\n    \"responseMessage\": \"{{$json.responseMessage}}\"\n  }\n}",
        "options": {}
      },
      "id": "response-node",
      "name": "\u54cd\u5e94\u5904\u7406",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        1120,
        300
      ]
    }
  ],
  "connections": {
    "Webhook\u63a5\u6536\u5668": {
      "main": [
        [
          {
            "node": "\u6570\u636e\u5904\u7406",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u6570\u636e\u5904\u7406": {
      "main": [
        [
          {
            "node": "\u68c0\u67e5\u8ba2\u9605\u72b6\u6001",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u68c0\u67e5\u8ba2\u9605\u72b6\u6001": {
      "main": [
        [
          {
            "node": "\u53d1\u9001\u90ae\u4ef6\u901a\u77e5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\u8bb0\u5f55\u65e5\u5fd7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u53d1\u9001\u90ae\u4ef6\u901a\u77e5": {
      "main": [
        [
          {
            "node": "\u8bb0\u5f55\u65e5\u5fd7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u8bb0\u5f55\u65e5\u5fd7": {
      "main": [
        [
          {
            "node": "\u54cd\u5e94\u5904\u7406",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {},
  "id": "form-processing-workflow"
}