How to use n8n + OpenAI to build an AI sales development representative system: 30 minutes of automated customer mining
Build a complete SDR Agent from scratch for automated lead mining, personalized contact, and CRM write-back
Tutorial Objectives
In 30 minutes, build an automated AI sales development representative (SDR) system with n8n + OpenAI. The system automatically mines leads from public data sources, uses AI to generate personalized outreach emails, and writes the results into a CRM.
What will you build?
- Automated Lead Miner: Automatically get a list of leads from CSV/Public API
- AI Personalization Engine: Use OpenAI to generate customized outreach content for each lead
- Automated sending pipeline: Automatically send via email API and track opens/replies
- CRM Writeback Bridge: Automatically log interaction results to HubSpot/Salesforce
Preparation list
- n8n account (Cloud free version is available, it is recommended to use n8n Cloud to reduce setup time)
- OpenAI API Key (platform.openai.com registered to obtain)
- A CSV file or Google Sheet with lead information
- Gmail/SendGrid account is used to send emails (optional, you can also send manually)
Overall architecture
This tutorial will build a complete SDR automation pipeline, divided into 4 core modules.
| Module | Input | Output | Estimated time |
|---|---|---|---|
| Lead import and cleaning | CSV/Google Sheet | Structured lead list | 5 minutes |
| AI personalized generation | Lead information + OpenAI | Personalized outreach copywriting | 10 minutes |
| Automatic sending queue | Copywriting + recipients | Sent emails + tracking records | 10 minutes |
| CRM writeback | Send results | Update lead status in CRM | 5 minutes |
Step 1: Build the lead import module
Start by creating a new workflow in n8n. Add a Google Sheets node (or Read CSV Files node) as the data source.
Configuration points:
- Data columns are recommended to include:
name,company,title,linkedin_url,email,industry - If there is no existing data, n8n's built-in HTTP Request node can obtain enterprise leads from Apollo API or Hunter.io
- Add a Filter node to filter invalid data (empty emails, incomplete records)
// Filter
{
"conditions": {
"email": { "exists": true },
"name": { "exists": true }
}
}**** n8n Cloud 5 , SDR 。, n8n 。
2 AI
。 OpenAI , "Create Message" 。
(System Prompt)
(SDR)。 outreach 。
、(,)
-
-
- [AI 60% ]
,,。OpenAI Messages , n8n
: {{ $json.name }}
: {{ $json.title }}
: {{ $json.company }}
: {{ $json.industry }}| Model | gpt-4o-mini | ,SDR |
| Temperature | 0.7 | |
| Max Tokens | 500 | |
| System Prompt | AI SDR |
Switch API → ; → 。
3
Gmail ( SendGrid ), AI 。
Gmail
- OAuth2 ( n8n Google )
{{ $json.email }}AI automation suggestions for {{ $json.company }}(){{ $json.generated_comment }}(AI )
**n8n **
- 24
- , AI follow-up
- , "" Slack
**** n8n Cloud ,。,n8n 。
4 CRM
HubSpot ( Salesforce ) CRM。
// HubSpot Update Contact
{
"resource": "contact",
"operation": "update",
"contactId": "{{ $json.hubspot_id }}",
"properties": {
"hs_lead_status": "contacted",
"last_contacted_date": "{{ $now.toISOString() }}",
"outreach_message_snippet": "{{ $json.generated_comment.slice(0, 200) }}"
}
}Google Sheets , outreach (、、),。
(FAQ)
Q1OpenAI API ?
OpenAI Settings Retry on Fail = 3 ,Timeout = 30 。, API Key gpt-4o-mini()。
Q2n8n Cloud ?
。 5 2500 /。 SDR ( 100-200 )。。
Q3?
SPF/DKIM (Gmail )。,AI prompt "," 。
SEO+GEOFAQ GEO ,
()
, tools hover-cardn8n、OpenAI、ChatGPT、Claude、DeepSeek、HubSpot、Slack
Reference video/material
Internal link guidance
- Someone has successfully practiced it: I used n8n + OpenAI to build AI content automation website: a complete review of monthly income $4,500
- Recommended tool: n8n
Related tutorials
How to Write .cursorrules: Cursor Prompt Engineering Guide (2026)
If Cursor's AI keeps generating code you have to fix every time, the problem is not the model: it is your rules file. A good .cursorrules can cut your edit-to-accept ratio from 3:1 to near 1:1. After eight months of iterating on Cursor rules across React, Python, and Go projects, this guide walks through what works, what breaks, and the templates I actually use.
Claude Code Pricing Guide: Plans, Credits, and Cost Optimization (2026)
I spend $80-150/month on Claude Code and use it 6-7 days a week. This guide breaks down exactly how Claude Code pricing works: per-token API billing, Anthropic credits, Max mode costs, the June 2026 billing change, and real monthly budgets from three developer profiles. I also share the six cost optimization techniques that cut my bill from $340 to $80 without reducing how much I ship.
Topic hub
AI Agent Tutorials & Workflow Guides
Evergreen how-tos for coding agents, content pipelines, and n8n automation—linked to news context and real earn cases.
Explore AI Agent Tutorials & Workflow Guides →Monetization angle
How can you make money from this trend?
WayToClawEarn focuses on verified earn playbooks—not just news. Start from these cases.
DeepSeek + Claude Code Micro SaaS
Run multiple small products on cheap inference
Claude Code bug bounty
Productize agent skills into security services