{
  "name": "Starter - Lead triage and follow-up",
  "nodes": [
    {
      "parameters": {
        "content": "# Lead triage starter\n\nThis safe starter workflow does not include credentials.\n\nRun it once with Manual Trigger, inspect the output of each Code node, then replace the placeholder No Operation nodes with your CRM, Slack, Email, or database nodes.",
        "height": 260,
        "width": 420
      },
      "id": "lead-note-2026",
      "name": "Read me first",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -760,
        -180
      ]
    },
    {
      "parameters": {},
      "id": "lead-manual-trigger-2026",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -760,
        160
      ]
    },
    {
      "parameters": {
        "jsCode": "return [\n  {\n    json: {\n      name: 'Mason Chen',\n      email: 'mason@example.com',\n      company: 'Example SaaS',\n      source: 'website_form',\n      budget: 'NT$100,000+',\n      message: '我們想導入 AI 自動化，想了解報價、時程和顧問合作方式。',\n      submitted_at: new Date().toISOString()\n    }\n  }\n];"
      },
      "id": "lead-sample-data-2026",
      "name": "Sample lead data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -520,
        160
      ]
    },
    {
      "parameters": {
        "jsCode": "const highIntentWords = ['報價', '合作', '預算', '導入', '顧問', 'demo', 'proposal', 'quote'];\n\nreturn items.map((item) => {\n  const lead = item.json;\n  const text = `${lead.message || ''} ${lead.budget || ''} ${lead.company || ''}`.toLowerCase();\n  let score = 20;\n\n  for (const word of highIntentWords) {\n    if (text.includes(word.toLowerCase())) score += 12;\n  }\n\n  if (lead.company) score += 10;\n  if ((lead.email || '').includes('@')) score += 10;\n  if ((lead.budget || '').match(/100,000|10萬|six figures/i)) score += 20;\n\n  score = Math.min(score, 100);\n  const route = score >= 60 ? 'sales_priority' : 'nurture';\n\n  return {\n    json: {\n      ...lead,\n      lead_score: score,\n      route,\n      next_action: route === 'sales_priority'\n        ? 'Create CRM task, notify sales, draft a reply for human review'\n        : 'Add to nurture list and send an educational follow-up'\n    }\n  };\n});"
      },
      "id": "lead-score-route-2026",
      "name": "Score and route lead",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -260,
        160
      ]
    },
    {
      "parameters": {},
      "id": "lead-crm-placeholder-2026",
      "name": "Replace with CRM update",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        20,
        160
      ]
    },
    {
      "parameters": {},
      "id": "lead-slack-placeholder-2026",
      "name": "Replace with Slack alert",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        280,
        160
      ]
    },
    {
      "parameters": {},
      "id": "lead-email-placeholder-2026",
      "name": "Replace with email draft",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        540,
        160
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Sample lead data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sample lead data": {
      "main": [
        [
          {
            "node": "Score and route lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Score and route lead": {
      "main": [
        [
          {
            "node": "Replace with CRM update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Replace with CRM update": {
      "main": [
        [
          {
            "node": "Replace with Slack alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Replace with Slack alert": {
      "main": [
        [
          {
            "node": "Replace with email draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "active": false,
  "tags": []
}
