WayToClawEarn
Intermediate30 min readMay 13, 2026

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

WayToClawEarn EditorialPublished May 13, 2026Updated Aug 8, 2026

Editorial review of public sources · AI-assisted drafting. How we work

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.

ModuleInputOutputEstimated time
Lead import and cleaningCSV/Google SheetStructured lead list5 minutes
AI personalized generationLead information + OpenAIPersonalized outreach copywriting10 minutes
Automatic sending queueCopywriting + recipientsSent emails + tracking records10 minutes
CRM writebackSend resultsUpdate lead status in CRM5 minutes

Text example — n8n workflow builder interface

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)
json
// Filter
{
  "conditions": {
    "email": { "exists": true },
    "name": { "exists": true }
  }
}

**** n8n Cloud 5 , SDR 。, n8n

2 AI

OpenAI , "Create Message" 。

(System Prompt)

code
(SDR)。 outreach 。
、(,)
-
-
- [AI 60% ]

,,。

OpenAI Messages , n8n

code
: {{ $json.name }}
: {{ $json.title }}
: {{ $json.company }}
: {{ $json.industry }}
Modelgpt-4o-mini,SDR
Temperature0.7
Max Tokens500
System PromptAI SDR

Text example — OpenAI node configuration in n8n

Switch API → ; → 。

3

GmailSendGrid ), 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

HubSpotSalesforce ) CRM。

json
// 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-cardn8nOpenAIChatGPTClaudeDeepSeekHubSpotSlack

Reference video/material

Internal link guidance

Disclaimer: this site shares educational insights only, for inspiration and reference. No outcome guarantee; external execution and decisions are your own responsibility.

Related tutorials