# n8n Form Lead Enrichment and CRM Sync

> Capture a lead via n8n Form Trigger, research the company website with an LLM, and upsert into a sheet or CRM.

Category: n8n Automation Blueprints  
Tags: n8n, forms, crm, enrichment  
Setup time (estimate): 1-2 hours  
Estimated cost: n8n plus one LLM call per lead; enrichment APIs may charge per lookup.  
Last verified: not yet independently verified

## Nodes

1. **n8n Form Trigger** – fields: name, email, company website.
2. **HTTP Request** – GET the website URL (response format: text; set a timeout).
3. **HTML** node – extract `body` text, or a Code node to strip tags and truncate to ~6000 chars.
4. **Basic LLM Chain** + Structured Output Parser – returns `{industry, size_guess, one_line_summary, fit_score_1_5}`.
5. **Google Sheets → Append or Update** (match on email) or your CRM node.
6. **IF** `fit_score_1_5 >= 4` → notify sales channel.

## Code node: clean text

```javascript
const html = $input.first().json.data || '';
const text = html.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>/gi, '')
                 .replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim();
return [{ json: { text: text.slice(0, 6000) } }];
```

Label `size_guess` and `fit_score` as model estimates in the CRM; they are not verified data.

## Failure modes

- Model guesses (size, fit score) get treated as facts in the CRM; label them as estimates.
- Duplicate leads create duplicate CRM records without an upsert key.
- Form spam burns tokens; filter before enrichment.
