如何為英國小型企業建立避免重複聯絡人的網站查詢至 CRM 流程
Building a website enquiry to CRM flow for a UK small business without duplicate contacts
這套面向英國小型企業的網站查詢至 CRM 流程,先清理資料並按電郵搜尋,再更新既有聯絡人或建立新紀錄,以避免重複聯絡人。文章以 n8n 示範在 Webhook 後用 Code node 清理電郵和電話,並列出告警、錯誤處理及交付測試項目。文中亦提醒建置前確認 UK GDPR 涉及的資料最小化、處理者合約、跨境傳輸及日誌保留問題。
One of the most common jobs a freelance automation builder gets from a UK small business sounds trivial: "when someone fills in the contact form, put them in the CRM and tell us." It takes ten minutes to wire up badly and a bit longer to wire up properly. The difference shows up a month later, when the client has three records for the same person, notes split across them and two staff members calling the same lead.
This post covers the pattern I'd scope and build, with a small n8n snippet, a test checklist you can hand to the client, and the UK GDPR questions worth asking before you start.
Why the naive version creates duplicates
The usual causes are boring, which is why they get missed:
- Create without search. The workflow creates a contact on every submission.
-
Formatting differences.
Jane@Example.comandjane@example.comlook like two people to many systems. - Several entry points. The contact form, a booking tool and a newsletter sign-up each create contacts separately.
- Retries. A step fails, the platform retries, and the create step runs twice.
An illustrative example: someone books a kitchen survey as Sarah.Jones@Example.com with a stray trailing space, then a week later asks for a quote as sarah.jones@example.com. Without a clean step and a search step, the CRM now holds two Sarahs.
The pattern
Whether you use Zapier, Make or n8n, the logic is the same:
- Receive the enquiry, ideally by webhook so it runs instantly.
- Clean the data: trim spaces, lower-case the email, normalise phone numbers.
- Search the CRM for a contact with that email.
- Branch: if found, update the contact and attach the enquiry as a note, activity or deal. If not found, create the contact, then attach the enquiry.
- Notify the team in email, Slack or Teams, with a link to the CRM record.
- Confirm to the enquirer that the message arrived.
- Handle errors: if the CRM is down, store the enquiry somewhere safe and alert a named person.
Some CRMs offer a single "find or create" or upsert action that collapses steps 3 and 4. Check the CRM's API docs before building the branch by hand, but still test it, because not every creation path in every CRM de-duplicates the same way.
The clean step in n8n
In n8n, the clean step is a Code node placed straight after the Webhook node. Something like this:
// n8n Code node, "Run Once for All Items"
return $input.all().map(item => {
const body = item.json.body ?? item.json;
const email = String(body.email ?? '')
.trim()
.toLowerCase();
// Keep digits and a leading +, then convert a UK 07... mobile to +447...
let phone = String(body.phone ?? '').replace(/[^\d+]/g, '');
if (phone.startsWith('07')) phone = '+44' + phone.slice(1);
return {
json: {
email,
phone,
name: String(body.name ?? '').trim(),
message: String(body.message ?? '').trim(),
source: body.source ?? 'website-form',
receivedAt: new Date().toISOString(),
},
};
});
Then:
- a CRM node (or HTTP Request node) that searches by email,
- an IF node on whether a contact came back,
- an update branch and a create branch that both end by adding the enquiry as a note,
- a notification node,
- and an Error Trigger workflow that alerts a named person and writes the raw payload somewhere recoverable.
One reason n8n suits this pattern: it bills by execution, so one full run counts once however many steps it has. Make bills per module run in credits, so extra steps cost more. Zapier's Free plan only allows two-step Zaps, and Paths need a paid plan, so this pattern needs at least its Professional tier. Check each provider's current pricing page before you quote, as these change.
Scoping questions to ask the client first
Before you quote, get answers to these. They change the build more than the tool choice does.
- How many entry points create contacts? Form, booking tool, newsletter, live chat, phone notes. Each one needs the same clean and search logic, or a shared sub-workflow.
- What is the unique key? Email is usual. If the business takes many phone-only enquiries, decide how to match those.
- Who gets error alerts? If nobody is named, do not ship it. A silent failure here means lost leads.
- What happens to spam? Filter, flag or drop, and who checks the flagged ones.
- Existing duplicates? Fix the workflow first, then merge. Back up before any bulk merge.
- Volume? At a few enquiries a week, copying by hand may well be fine, and it is worth saying so.
A test checklist to hand over
Submit test enquiries and check, with the client watching if possible:
- [ ] A brand new email creates exactly one contact
- [ ] The same email again updates that contact, not a new one
- [ ] The same email in capitals, or with a trailing space, still matches
- [ ] The team alert links to the correct CRM record
- [ ] A failed CRM step alerts a named person and the enquiry is not lost
- [ ] Spam submissions are filtered or flagged
Agreeing this list at the start makes sign-off much simpler.
UK GDPR: the questions a good builder raises
Enquiries contain personal data, and in the UK that means UK GDPR applies to your workflow just as it does to any other system. You are not the client's lawyer, but raising these points makes you look like someone who has done this before:
- Data minimisation. Only pass the fields the workflow needs. If an LLM step summarises the message, does it need the phone number?
- Processor contracts. Every service in the chain (automation platform, CRM, any model provider, any transcription service) is usually a processor, and UK GDPR requires a written contract with each. For SaaS tools that is normally a data processing agreement.
- Where the data goes. Many services process data outside the UK, often in the USA. That is a restricted transfer and needs a legal route, so check the supplier's terms. If you self-host n8n, you control the location of that part of the chain.
- Privacy notice. The client's notice should cover the CRM and the automation tool.
- Breaches. The ICO says a notifiable personal data breach must be reported without undue delay and within 72 hours of becoming aware of it, where feasible. A misconfigured automation that emails the wrong customer is exactly the kind of incident to plan for.
- Retention. Execution logs in n8n or Make may hold full payloads. Decide how long to keep them.
The ICO's guidance on AI and data protection and its international transfers guidance are the primary sources here.
Wrapping up
The search-then-branch step is the whole trick. Get it right and almost any tool will work. Skip it and every tool will make a mess.
We wrote a longer, non-technical version of this for business owners, including a comparison of how Zapier, Make and n8n bill for this pattern: automating website enquiries without duplicate CRM contacts. If you are a UK business owner who found this and would rather not build it yourself, you can get matched with UK automation agencies for free.
TrustedAIAgencies team
來源:DEV Community · dev.to