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
Editorial original
Written by WayToClawEarn editorial; cite this page as the primary analysis.
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 Build an AI Agent in n8n: Complete Beginner Guide 2026
If you want to build an AI agent in n8n that fetches GitHub pull requests and sends Slack summaries — this tutorial gives you the complete step-by-step guide, from Docker self-hosting to a deployed agent with memory, tools, error handling, and production security in about 45 minutes.
Build an AI Agent in n8n: Complete Step-by-Step Tutorial
If you want to automate tasks with AI without writing backend code, n8n's AI Agent node lets you build intelligent workflows from a drag-and-drop canvas. This step-by-step guide covers everything from Docker installation to a working agent that searches the web, reads articles, summarizes content, and saves results to Google Sheets — all in under 30 minutes.
How to use n8n + OpenAI to build an automated content collection and publishing workflow: from zero to one in 30 minutes
Starting from scratch, use n8n visualization to build a fully automatic workflow for AI content collection, rewriting, and publishing.
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
Related tutorials
Related news
- llama.cpp Adds Native Decision Model Support: 5 Open GGUFs, How to Cut Agent Routing Cost?
- Xiaomi MiMo-V2.6-Pro Hits Agent Arena: #5 Open-Source, #2 in Confirmed Success — How to Choose Agent Models?
- LangChain Open-Sources Model Router: 64% Cost Cut in Agent Coding with No Quality Loss — How to Build Yours
- Karpathy Proposes 4-Rung LLM Output Ladder: STE100, Diagrams, HTML, Video — How Humans Understand Autonomous Agent Work?