n8n CRM lead routing with sample data
AI Techbom · Automation · · 4 min read
Download the n8n workflow JSONBefore writing enquiries into a CRM, run the assignment rules on examples. This downloadable n8n workflow takes five synthetic enquiries and previews which team gets each one, which need review and which repeat an earlier event. It uses a manual trigger and two Code nodes. The workflow has no credentials and makes no external writes.
Import and run the workflow
Import the JSON into an n8n test workspace from the workflow editor, then run it manually. Open the output of Plan CRM actions. Each input yields one planned action using the source event ID, the email field and a small service-to-queue mapping. We verified all five outputs in n8n 2.48.7.
| Input | Expected outcome | Reason |
|---|---|---|
| lead-001, software | Route to software-sales | The event has an email and a mapped service. |
| lead-001 again | Skip | The same event ID has already been seen in this batch. |
| lead-002, no email | Review | An operator needs contact information. |
| lead-003, automation | Route to automation-sales | The automation team owns that service. |
| lead-004, other | Review | The requested service has no matching queue. |
Make the retry test meaningful before enabling writes
The sample detects repeats inside a single run. A production integration also needs to remember events across executions. Use a stable ID from the source and a storage or destination system that can enforce uniqueness. Test what happens if the CRM accepts the write and the connection drops before n8n receives the response. A retry should recover the existing record.
Treat an edited enquiry as a separate version. If your team approves exceptions, record which version it reviewed. When fields change after approval, put the updated record back in review before allowing a write.
Scope one field map and one owner
Replace the sample with a redacted export first. Confirm which field identifies a contact, where a new enquiry should be attached and who owns missing or conflicting details. Add a CRM write only after the proposed actions agree with the operator's decisions and the retry tests pass in a test account.
Need this connected to a real source, review queue and CRM? n8n workflow implementation services