{
  "name": "Company & Contact Signals Detection + Enrichment with Lusha",
  "nodes": [
    {
      "id": "03211c14-0558-4cc9-b280-f3633754377f",
      "name": "\ud83d\udccb Company & Contact Signals Detection",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -100,
        -540
      ],
      "parameters": {
        "width": 900,
        "height": 520,
        "content": "## Company & Contact Signals Detection + Enrichment\n\n**Who it's for:** Sales teams who want to identify accounts showing buying intent\n\n**What it does:** Detects company signals (growth, hiring, funding) and enriches both account and contact records. Uses Lusha bulk enrichment for efficiency.\n\n### How it works\n1. Runs daily to check target accounts from your CRM\n2. Bulk-enriches all companies in one API call with Lusha\n3. Detects growth signals (headcount changes, revenue growth, funding)\n4. Searches key contacts at signal-showing accounts\n5. Alerts sales team with signal summaries via Slack\n6. Updates CRM with all enriched data\n\n### Setup\n1. Install the Lusha community node\n2. Configure CRM credentials\n3. Add Lusha API credentials\n4. Define your target account list or ICP filters\n5. Configure Slack channel for signal alerts"
      },
      "typeVersion": 1
    },
    {
      "id": "221233f5-be3e-4824-8e84-4275794b015d",
      "name": "\ud83d\udcc5 1. Daily Account Pull",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -30,
        70
      ],
      "parameters": {
        "color": 7,
        "width": 520,
        "height": 270,
        "content": "A daily schedule pulls your target accounts from HubSpot for signal monitoring.\n\n**Nodes:** Schedule Trigger \u2192 HubSpot Get Companies\n\n\ud83d\udca1 Define your target account list in HubSpot using filters or a dedicated list."
      },
      "typeVersion": 1
    },
    {
      "id": "2b9c1e9a-d48d-467f-8a42-a77036ed3bb0",
      "name": "\ud83d\udd04 2. Company Bulk Enrichment",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        550,
        70
      ],
      "parameters": {
        "color": 7,
        "width": 580,
        "height": 270,
        "content": "All target accounts are formatted and enriched via the Lusha Company Bulk API in a single call. Returns employee count, revenue, funding, and industry data.\n\n**Nodes:** Format Companies \u2192 Lusha Company Bulk Enrich\n\n\ud83d\udcd6 [Lusha API docs](https://www.lusha.com/docs/)"
      },
      "typeVersion": 1
    },
    {
      "id": "23a1b2b4-428e-4b5d-b451-0e20a0aa3109",
      "name": "\ud83d\udce4 3. Detect Signals & Alert Sales",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1150,
        70
      ],
      "parameters": {
        "color": 7,
        "width": 1450,
        "height": 300,
        "content": "A code node compares fresh Lusha data vs CRM records to detect growth signals: headcount increase (10%+), revenue growth (15%+), and funding activity. For accounts showing signals, Lusha searches for key contacts and alerts your sales team via Slack.\n\n**Nodes:** Detect Signals \u2192 Has Signals? \u2192 Search Contacts + Update CRM \u2192 Enrich Contacts \u2192 Slack Alert\n\n\ud83d\udca1 Adjust signal thresholds in the Code node to match your definition of growth."
      },
      "typeVersion": 1
    },
    {
      "id": "5611e317-980f-40da-b283-503a20562b3f",
      "name": "Daily Signal Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        340
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c9873e32-cbc3-4c4b-b796-b3038562960e",
      "name": "Get Target Accounts from CRM",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        300,
        340
      ],
      "parameters": {
        "limit": 50,
        "resource": "company",
        "operation": "getAll",
        "returnAll": false
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "c45060ec-77c0-4be0-93b5-af686d0a8146",
      "name": "Format Companies for Bulk",
      "type": "n8n-nodes-base.code",
      "position": [
        600,
        340
      ],
      "parameters": {
        "jsCode": "// Format CRM companies for Lusha Company Bulk Enrichment\nconst items = $input.all();\nlet idCounter = 1;\n\nconst companies = items\n  .filter(item => item.json.properties?.domain)\n  .map(item => ({\n    id: String(idCounter++),\n    domain: item.json.properties.domain,\n    crmId: item.json.id,\n    crmName: item.json.properties?.name || '',\n    crmEmployees: item.json.properties?.numberofemployees || '0',\n    crmRevenue: item.json.properties?.annualrevenue || '0'\n  }));\n\nconst payload = { companies: companies.map(c => ({ id: c.id, domain: c.domain })) };\n\n// Store CRM data alongside payload for signal detection later\nreturn [{\n  json: {\n    companiesPayload: JSON.stringify(payload),\n    crmLookup: Object.fromEntries(\n      companies.map(c => [c.domain, { crmId: c.crmId, name: c.crmName, employees: c.crmEmployees, revenue: c.crmRevenue }])\n    )\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "0e5522c8-43c8-4168-9908-358edbfa17b5",
      "name": "Enrich All Companies in Bulk",
      "type": "@lusha-org/n8n-nodes-lusha.lusha",
      "position": [
        900,
        340
      ],
      "parameters": {
        "resource": "company",
        "operation": "enrichBulk",
        "companyBulkType": "json",
        "companiesPayloadJson": "={{ $json.companiesPayload }}"
      },
      "credentials": {
        "lushaApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "10d4fbdc-0555-4b26-830d-a0c54ebad5e4",
      "name": "Detect Signals per Company",
      "type": "n8n-nodes-base.code",
      "position": [
        1200,
        340
      ],
      "parameters": {
        "jsCode": "// Detect signals for each company in the bulk response\n// Match bulk results back to CRM data using domain\nconst bulkResults = $input.all();\nconst crmLookup = $('Format Companies for Bulk').first().json.crmLookup;\n\nconst output = [];\nfor (const item of bulkResults) {\n  const lusha = item.json;\n  const domain = lusha.domain || '';\n  const crm = crmLookup[domain] || {};\n\n  const signals = [];\n  const crmEmpCount = parseInt(crm.employees || '0');\n  const lushaEmployees = parseInt(lusha.employees || '0');\n\n  // Growth signal: headcount increased 10%+\n  if (crmEmpCount > 0 && lushaEmployees > 0) {\n    const growth = ((lushaEmployees - crmEmpCount) / crmEmpCount) * 100;\n    if (growth >= 10) {\n      signals.push({\n        type: 'headcount_growth',\n        detail: `+${growth.toFixed(0)}% (${crmEmpCount} \u2192 ${lushaEmployees})`,\n        strength: growth >= 25 ? 'strong' : 'moderate'\n      });\n    }\n  }\n\n  // Revenue growth check\n  const lushaRevMax = Array.isArray(lusha.revenueRange) ? lusha.revenueRange[1] : 0;\n  const crmRevenue = parseFloat(crm.revenue || '0');\n  if (lushaRevMax > 0 && crmRevenue > 0) {\n    const revGrowth = ((lushaRevMax - crmRevenue) / crmRevenue) * 100;\n    if (revGrowth >= 15) {\n      signals.push({ type: 'revenue_growth', detail: `+${revGrowth.toFixed(0)}%`, strength: 'strong' });\n    }\n  }\n\n  // Funding signal\n  if (lusha.funding && Object.keys(lusha.funding).length > 0) {\n    signals.push({ type: 'has_funding_data', detail: 'Funding data available', strength: 'moderate' });\n  }\n\n  output.push({\n    json: {\n      companyId: crm.crmId || '',\n      companyName: lusha.name || crm.name || '',\n      domain,\n      currentEmployeeCount: lushaEmployees,\n      previousEmployeeCount: crmEmpCount,\n      industry: lusha.mainIndustry,\n      revenueRange: lusha.revenueRange,\n      signals,\n      hasSignals: signals.length > 0,\n      signalStrength: signals.some(s => s.strength === 'strong') ? 'strong' : signals.length > 0 ? 'moderate' : 'none'\n    }\n  });\n}\n\nreturn output;"
      },
      "typeVersion": 2
    },
    {
      "id": "7211ab58-687b-42d1-acd7-dea29cf72e82",
      "name": "Has Signals?",
      "type": "n8n-nodes-base.if",
      "position": [
        1500,
        340
      ],
      "parameters": {
        "conditions": {
          "combinator": "and",
          "conditions": [
            {
              "id": "532146bd-fbfc-4d11-b554-4ca0e574a936",
              "operator": {
                "type": "boolean",
                "operation": "true"
              },
              "leftValue": "={{ $json.hasSignals }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "67e8012e-9e8c-4c6c-853f-217089efa80a",
      "name": "Search for Key Contacts",
      "type": "@lusha-org/n8n-nodes-lusha.lusha",
      "position": [
        1800,
        240
      ],
      "parameters": {
        "operation": "searchContacts",
        "contactSearchFilters": {},
        "searchAdditionalOptions": {}
      },
      "credentials": {
        "lushaApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6c744d54-80c1-46f9-99e4-d976915ecd7c",
      "name": "Enrich Contacts from Search",
      "type": "@lusha-org/n8n-nodes-lusha.lusha",
      "position": [
        2100,
        240
      ],
      "parameters": {
        "operation": "enrichFromSearch",
        "contactSelectionType": "all"
      },
      "credentials": {
        "lushaApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7dc4f7c0-abdf-417f-a7fd-fe0f017bd918",
      "name": "Signal Alert to Sales",
      "type": "n8n-nodes-base.slack",
      "position": [
        2400,
        240
      ],
      "parameters": {
        "text": "=\ud83d\udce1 *Account Signal Alert*\n\n*{{ $('Detect Signals per Company').item.json.companyName }}* ({{ $('Detect Signals per Company').item.json.domain }})\n\n*Signals detected:*\n{{ $('Detect Signals per Company').item.json.signals.map(s => `\u2022 ${s.type}: ${s.detail} [${s.strength}]`).join('\\n') }}\n\n*Key contacts found \u2014 see CRM for details.*",
        "channel": "#account-signals",
        "otherOptions": {}
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "d8b07baf-f406-4879-bccb-6dd1b8f8eaae",
      "name": "Update Account in CRM",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        2100,
        440
      ],
      "parameters": {
        "resource": "company",
        "companyId": "={{ $('Detect Signals per Company').item.json.companyId }}",
        "operation": "update",
        "updateFields": {
          "industry": "={{ $('Detect Signals per Company').item.json.industry }}",
          "numberofemployees": "={{ $('Detect Signals per Company').item.json.currentEmployeeCount }}"
        }
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    }
  ],
  "connections": {
    "Has Signals?": {
      "main": [
        [
          {
            "node": "Search for Key Contacts",
            "type": "main",
            "index": 0
          },
          {
            "node": "Update Account in CRM",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Daily Signal Check": {
      "main": [
        [
          {
            "node": "Get Target Accounts from CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search for Key Contacts": {
      "main": [
        [
          {
            "node": "Enrich Contacts from Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Companies for Bulk": {
      "main": [
        [
          {
            "node": "Enrich All Companies in Bulk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Signals per Company": {
      "main": [
        [
          {
            "node": "Has Signals?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich Contacts from Search": {
      "main": [
        [
          {
            "node": "Signal Alert to Sales",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich All Companies in Bulk": {
      "main": [
        [
          {
            "node": "Detect Signals per Company",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Target Accounts from CRM": {
      "main": [
        [
          {
            "node": "Format Companies for Bulk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}