Deduplicate CSV leads and rank key contacts with OpenRouter Claude Haiku
Ready for 3.0What this workflow does
This workflow has 14 nodes and runs when someone submits an n8n form (“Upload Leads File”). It uses only n8n's built-in nodes. It also calls openrouter.ai over HTTP.
How it runs
Trigger: When someone submits an n8n form (“Upload Leads File”).
- Set Workflow Parameters (Edit Fields (Set)): sets 3 fields: sheetName, aiModel, maxRowsInCleanedCSV
- Extract Data from XLSX (Extract from File): extracts data from a file (xlsx)
- Group by Organization (Code): runs custom JavaScript code
- Limit: keeps the first few items
- Compile Report Data (Code): runs custom JavaScript code
- Check AI Ranking Requirement (If): checks a condition and branches into true / false
- Export Report to File (Convert to File): converts data to a file (to json)
- Prepare AI Prompt (Code): runs custom JavaScript code
- Select Single Contact (Code): runs custom JavaScript code
- Post to OpenRouter API (HTTP Request): calls openrouter.ai (POST)
…plus 3 more steps. See the full node list below.
HTTP calls to: openrouter.ai
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (9)
- n8n Form Trigger
n8n-nodes-base.formTrigger - Edit Fields (Set)
n8n-nodes-base.set - Extract from File
n8n-nodes-base.extractFromFile - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Merge
n8n-nodes-base.merge - Convert to File
n8n-nodes-base.convertToFile - Limit
n8n-nodes-base.limit
From the author
Quick overview This workflow accepts a uploaded CSV/XLSX leads file, groups rows by organization, and deduplicates to one contact per company. If multiple named contacts exist, it calls OpenRouter (chat completions) to pick the most senior person, then…