{
  "name": "Automated CRM Signal Sync & Workflow Activation with Lusha",
  "nodes": [
    {
      "id": "b1a52b66-0367-4a38-96f6-706c1a1f0de2",
      "name": "\ud83d\udccb CRM Signal Sync & Workflow Activation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -100,
        -520
      ],
      "parameters": {
        "width": 900,
        "height": 500,
        "content": "## Automated CRM Signal Sync with Lusha\n\n**Who it's for:** RevOps teams managing data hygiene and workflow triggers\n\n**What it does:** Automatically enriches CRM contacts **in bulk** with Lusha, applies qualification logic, and enrolls them in the correct workflows.\n\n### How it works\n1. Runs on a schedule (hourly/daily)\n2. Pulls contacts missing data or needing refresh from CRM\n3. Formats contacts for Lusha Bulk Enrichment API\n4. Enriches all contacts in a single bulk API call\n5. Applies ICP qualification logic to each result\n6. Updates CRM and routes qualified contacts to workflows\n\n### Setup\n1. Install the Lusha community node\n2. Configure CRM credentials\n3. Add Lusha API credentials\n4. Customize ICP criteria in the qualification node\n5. Set target workflows/sequences for each tier"
      },
      "typeVersion": 1
    },
    {
      "id": "6776a73e-702f-4e82-b206-93b7702b4617",
      "name": "\ud83d\udcc5 1. Scheduled CRM Pull",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -30,
        70
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 270,
        "content": "Runs every 6 hours to pull contacts that need a data refresh from HubSpot.\n\n**Nodes:** Schedule Trigger (6h) \u2192 HubSpot Get Contacts\n\n\ud83d\udca1 Adjust the schedule interval and contact limit to match your data freshness needs."
      },
      "typeVersion": 1
    },
    {
      "id": "aae9d9f7-9234-4a9e-a332-3fd39e735485",
      "name": "\ud83d\udd04 2. Bulk Enrich with Lusha",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        510,
        70
      ],
      "parameters": {
        "color": 7,
        "width": 560,
        "height": 270,
        "content": "All contacts are formatted into a single payload and enriched via the Lusha Bulk API \u2014 far more efficient than enriching one-by-one.\n\n**Nodes:** Format for Bulk \u2192 Lusha Bulk Enrich\n\n\ud83d\udcd6 [Lusha API docs](https://www.lusha.com/docs/)"
      },
      "typeVersion": 1
    },
    {
      "id": "d1a23872-21d5-471b-a631-1a6d903aa834",
      "name": "\ud83d\udce4 3. Qualify, Update & Route",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        70
      ],
      "parameters": {
        "color": 7,
        "width": 710,
        "height": 300,
        "content": "Each enriched contact is scored against your ICP criteria (seniority, company size, industry). CRM records are updated with fresh data, and high-scoring leads trigger a Slack alert for fast-track outreach.\n\n**Nodes:** ICP Scoring \u2192 Update CRM \u2192 Fast-Track Check \u2192 Slack Alert\n\n\ud83d\udca1 Customize the ICP weights and score thresholds in the Code node."
      },
      "typeVersion": 1
    },
    {
      "id": "fff82ca0-8701-4af6-bc39-1d78064204b1",
      "name": "Scheduled Sync (Every 6 Hours)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        340
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "59017b46-fe92-44c5-84ff-b1e9ecbe9987",
      "name": "Get Contacts Needing Refresh",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        280,
        340
      ],
      "parameters": {
        "limit": 200,
        "filters": {
          "formSubmissionMode": "none"
        },
        "resource": "contact",
        "operation": "getAll",
        "returnAll": false
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "91c61e6b-1e85-4232-a100-af7455b0cca1",
      "name": "Format for Bulk Enrichment",
      "type": "n8n-nodes-base.code",
      "position": [
        560,
        340
      ],
      "parameters": {
        "jsCode": "// Format ALL CRM contacts for Lusha Bulk Enrichment API\n// Builds the full payload: { contacts: [...], metadata: {} }\nconst items = $input.all();\nlet contactIdCounter = 1;\n\nconst contacts = items\n  .filter(item => item.json.properties?.email)\n  .map(item => ({\n    contactId: String(contactIdCounter++),\n    email: item.json.properties.email\n  }));\n\nconst payload = {\n  contacts,\n  metadata: {}\n};\n\nreturn [{ json: { contactsPayload: JSON.stringify(payload) } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "d2dcdc10-b996-4d7b-b8b0-218a3c5d61aa",
      "name": "Enrich All Contacts in Bulk",
      "type": "@lusha-org/n8n-nodes-lusha.lusha",
      "position": [
        840,
        340
      ],
      "parameters": {
        "bulkType": "json",
        "operation": "enrichBulk",
        "contactsPayloadJson": "={{ $json.contactsPayload }}",
        "contactBulkAdditionalOptions": {}
      },
      "credentials": {
        "lushaApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "828dde25-9775-41e3-91a8-c30cd0aa5a0a",
      "name": "Qualify & Route Each",
      "type": "n8n-nodes-base.code",
      "position": [
        1120,
        340
      ],
      "parameters": {
        "jsCode": "// ICP Qualification Logic \u2014 process each bulk-enriched contact\n// Match enriched results back to original CRM records by email\nconst items = $input.all();\nconst crmContacts = $('Get Contacts Needing Refresh').all();\n\n// Build email \u2192 CRM record lookup\nconst crmByEmail = {};\nfor (const c of crmContacts) {\n  const email = (c.json.properties?.email || '').toLowerCase();\n  if (email) crmByEmail[email] = c.json;\n}\n\nconst ICP = {\n  targetSeniority: ['vp', 'director', 'c-suite', 'founder', 'head'],\n  minCompanySize: 50,\n  targetIndustries: ['technology', 'software', 'saas', 'fintech'],\n};\n\nconst results = [];\nfor (const item of items) {\n  const lusha = item.json;\n  const email = (lusha.primaryEmail || '').toLowerCase();\n  const crm = crmByEmail[email] || {};\n\n  let qualScore = 0;\n  const signals = [];\n\n  // Seniority scoring\n  const seniority = (lusha.seniority || '').toLowerCase();\n  if (ICP.targetSeniority.some(s => seniority.includes(s))) {\n    qualScore += 30; signals.push('ICP seniority match');\n  }\n\n  // Company size scoring\n  const empMax = Array.isArray(lusha.companySize) ? lusha.companySize[1] : 0;\n  if (empMax >= ICP.minCompanySize) {\n    qualScore += 25; signals.push(`Company size: ${empMax}`);\n  }\n\n  // Industry scoring\n  const industry = (lusha.companyMainIndustry || '').toLowerCase();\n  if (ICP.targetIndustries.some(i => industry.includes(i))) {\n    qualScore += 20; signals.push('Target industry match');\n  }\n\n  if (lusha.primaryPhone) { qualScore += 10; signals.push('Has phone'); }\n  if (lusha.primaryEmail) { qualScore += 10; signals.push('Has verified email'); }\n\n  let workflow = 'nurture';\n  if (qualScore >= 70) workflow = 'fast-track';\n  else if (qualScore >= 40) workflow = 'standard-outreach';\n\n  results.push({\n    json: {\n      contactId: crm.id || '',\n      email: crm.properties?.email || lusha.primaryEmail,\n      firstName: lusha.firstName || crm.properties?.firstname,\n      lastName: lusha.lastName || crm.properties?.lastname,\n      jobTitle: lusha.jobTitle,\n      seniority: lusha.seniority,\n      phone: lusha.primaryPhone,\n      company: lusha.companyName,\n      companySize: empMax,\n      industry: lusha.companyMainIndustry,\n      qualificationScore: qualScore,\n      signals,\n      targetWorkflow: workflow,\n      syncedAt: new Date().toISOString()\n    }\n  });\n}\n\nreturn results;"
      },
      "typeVersion": 2
    },
    {
      "id": "6f166aee-c990-4240-b14e-7c638bd80f42",
      "name": "Update CRM with Enriched Data",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1400,
        340
      ],
      "parameters": {
        "resource": "contact",
        "contactId": "={{ $json.contactId }}",
        "operation": "update",
        "updateFields": {
          "phone": "={{ $json.phone }}",
          "company": "={{ $json.company }}",
          "industry": "={{ $json.industry }}",
          "jobtitle": "={{ $json.jobTitle }}",
          "numberofemployees": "={{ $json.companySize }}"
        }
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e215b369-51a9-484b-ac2d-8b67e5eeec85",
      "name": "Fast-Track Qualified?",
      "type": "n8n-nodes-base.if",
      "position": [
        1680,
        340
      ],
      "parameters": {
        "conditions": {
          "combinator": "and",
          "conditions": [
            {
              "id": "9f05bfb2-175a-4999-a359-bdfb9d065118",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.targetWorkflow }}",
              "rightValue": "fast-track"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "2da3b0da-b43f-49c2-b703-355774ce3ade",
      "name": "Fast-Track Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        1960,
        200
      ],
      "parameters": {
        "text": "=\u26a1 *Fast-Track Lead*\n\n*{{ $json.firstName }} {{ $json.lastName }}*\n{{ $json.jobTitle }} at {{ $json.company }}\nScore: {{ $json.qualificationScore }}\nSignals: {{ $json.signals.join(', ') }}\n\ud83d\udce7 {{ $json.email }} | \ud83d\udcf1 {{ $json.phone || 'N/A' }}",
        "channel": "#fast-track-leads",
        "otherOptions": {}
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    }
  ],
  "connections": {
    "Qualify & Route Each": {
      "main": [
        [
          {
            "node": "Update CRM with Enriched Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fast-Track Qualified?": {
      "main": [
        [
          {
            "node": "Fast-Track Alert",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Format for Bulk Enrichment": {
      "main": [
        [
          {
            "node": "Enrich All Contacts in Bulk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich All Contacts in Bulk": {
      "main": [
        [
          {
            "node": "Qualify & Route Each",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Contacts Needing Refresh": {
      "main": [
        [
          {
            "node": "Format for Bulk Enrichment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update CRM with Enriched Data": {
      "main": [
        [
          {
            "node": "Fast-Track Qualified?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scheduled Sync (Every 6 Hours)": {
      "main": [
        [
          {
            "node": "Get Contacts Needing Refresh",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}