n8n CRM Automation: Connect Your Sales Stack Without Code
Automate your entire CRM workflow with n8n. Sync contacts across HubSpot, Salesforce, and Pipedrive. Automate lead routing, deal tracking, and follow-ups. Complete integration guide.

n8n CRM Automation: Connect Your Sales Stack Without Code
Your CRM is the single source of truth for your sales team — but without automation, it's a manual data entry nightmare. n8n connects your entire sales stack: forms, email, calendar, phone, and enrichment tools — keeping your CRM updated automatically.
The Automated CRM Stack
Lead Sources → n8n → CRM → Follow-ups → Analytics
↓ ↓ ↓ ↓ ↓
Web forms Enrich HubSpot Email seq Dashboard
Ads Score SFDC Tasks Reports
Events Route Pipedrive Slack Forecast
Workflow 1: Universal Contact Sync
Keep contacts synchronized across tools:
HubSpot ↔ Other Platforms
// Bidirectional sync HubSpot ↔ Salesforce
// When contact updates in HubSpot, push to Salesforce
// When contact updates in Salesforce, push to HubSpot
const source = $input.item.json.source;
const contact = $input.item.json.contact;
if (source === 'hubspot') {
// Update in Salesforce
await salesforce.upsert('Contact', 'Email', {
Email: contact.email,
FirstName: contact.firstname,
LastName: contact.lastname,
Title: contact.jobtitle,
Phone: contact.phone
});
} else if (source === 'salesforce') {
// Update in HubSpot
await hubspot.createOrUpdateContact(contact.email, {
firstname: contact.FirstName,
lastname: contact.LastName,
jobtitle: contact.Title,
phone: contact.Phone
});
}
Common Sync Patterns
| Sync | Use Case | Frequency |
|---|---|---|
| Form → CRM | New leads from website | Real-time |
| CRM → Email | Welcome/onboarding sequences | Trigger-based |
| CRM → Calendar | Meeting booked → CRM update | Real-time |
| Phone → CRM | Call logged → contact updated | Real-time |
| CRM → Slack | Important deal changes | Trigger-based |
Workflow 2: Intelligent Lead Routing
Match leads to the right rep automatically:
// Rule-based routing
const lead = $input.item.json;
const routingRules = {
enterprise: lead.company_size > 500,
midmarket: lead.company_size > 50 && lead.company_size <= 500,
smb: lead.company_size <= 50,
byTerritory: {
'US_West': ['CA', 'OR', 'WA', 'NV', 'AZ'],
'US_East': ['NY', 'NJ', 'MA', 'CT', 'PA'],
'EMEA': ['UK', 'DE', 'FR', 'NL', 'ES'],
},
};
// Determine route
let assignment;
if (routingRules.enterprise) {
assignment = 'Enterprise Team (round-robin)';
} else {
// Territory-based for smaller accounts
const territory = Object.entries(routingRules.byTerritory)
.find(([_, states]) => states.includes(lead.state));
assignment = territory ? territory[0] : 'General Queue';
}
// Create CRM task for assigned rep
await crm.createTask({
title: `New lead: ${lead.company}`,
assigned_to: assignment,
due_date: new Date(Date.now() + 24 * 60 * 60 * 1000), // 24 hours
});
Workflow 3: Deal Pipeline Automation
Automate deal progression and prevent stalled deals:
Deal Stage Automation
// When deal stage changes, trigger automations
const deal = $input.item.json;
const stageActions = {
'Proposal Sent': async () => {
// Schedule follow-up if no response in 48 hours
await scheduleTask(deal, 'Follow up on proposal', 48);
// Notify manager of big deals
if (deal.amount > 50000) {
await notifyManager(deal);
}
},
'Negotiation': async () => {
// Pull in deal support resources
await createDealRoom(deal); // Slack channel or doc
// Update forecast
await updateForecast(deal);
},
'Closed Won': async () => {
// Trigger onboarding workflow
await startOnboarding(deal);
// Send celebration to team
await celebrateDeal(deal);
// Create upsell opportunity in 90 days
await scheduleUpsell(deal, 90);
},
'Closed Lost': async () => {
// Log loss reason
await recordLossReason(deal);
// Add to nurture sequence after 3 months
await scheduleReengagement(deal, 90);
}
};
const action = stageActions[deal.stage];
if (action) await action();
Workflow 4: Email and Calendar Automation
Meeting → CRM Update
Calendly/Cal.com webhook → n8n → Create CRM Activity → Update Contact → Send Prep Email
// When someone books a meeting
const booking = $input.item.json;
// 1. Find or create contact in CRM
const contact = await findOrCreateContact(booking.email, {
name: booking.name,
company: booking.company
});
// 2. Log the meeting
await crm.createActivity({
type: 'meeting',
subject: booking.title,
date: booking.start_time,
contact_id: contact.id
});
// 3. Send prep email with meeting details
await sendEmail({
to: booking.email,
subject: `Confirmed: ${booking.title}`,
body: `Looking forward to meeting on ${formatDate(booking.start_time)}...`
});
Email Tracking
// Track email opens and clicks back to CRM
// Inbound: webhook from email service (SendGrid, Mailgun)
// Outbound: log in CRM timeline
await crm.createNote(contact.id, `Email "${subject}" opened at ${timestamp}`);
Workflow 5: Enrichment and Scoring
Automatic Contact Enrichment
// When a new contact is created, enrich automatically
const contact = $input.item.json;
const enrichments = {};
// Clearbit — company data
try {
const cb = await clearbit.enrich(contact.email);
enrichments.company = {
name: cb.company.name,
size: cb.company.metrics.employees,
industry: cb.company.category.sector,
revenue: cb.company.metrics.annualRevenue,
tech: cb.company.tech
};
} catch (e) { /* enrichment failed, continue */ }
// LinkedIn — social data
// Update CRM with enrichment data
await crm.updateContact(contact.id, enrichments);
Platform-Specific Integration Guides
HubSpot
// HubSpot has the deepest n8n integration
// Native nodes for: Contacts, Companies, Deals, Tickets, Engagements
const hubspot = $input.item.json;
// Create deal with associated contact
await hubspot.createDeal({
dealname: `${contact.company} - Enterprise Plan`,
amount: 50000,
pipeline: 'default',
dealstage: 'appointmentscheduled',
associations: {
contactIds: [contact.id],
companyIds: [contact.company_id]
}
});
Salesforce
// Full CRUD on standard and custom objects
const sf = $input.item.json;
// Upsert contact (create or update by email)
await sf.upsert('Contact', 'Email', {
Email: '[email protected]',
FirstName: 'Jane',
LastName: 'Smith',
AccountId: accountId
});
Pipedrive
// Deal-focused CRM, excellent API
const pd = $input.item.json;
// Create deal and move through stages
const deal = await pd.createDeal({
title: 'New Deal from Website',
value: 10000,
currency: 'USD',
person_id: personId,
stage_id: 1
});
Analytics and Reporting
Automated Sales Reports
// Weekly sales digest
// Runs every Monday at 8 AM
const metrics = {
newLeads: await countLeads('this week'),
dealsCreated: await countDeals('this week'),
dealsClosed: await sumDealsClosed('this week'),
pipelineValue: await sumPipeline('current'),
winRate: await calculateWinRate('this month'),
avgDealSize: await averageDealSize('this month'),
cycleTime: await averageDealCycle('this quarter')
};
// Generate Slack message
const report = `
📊 *Weekly Sales Report*
New Leads: ${metrics.newLeads}
Deals Created: ${metrics.dealsCreated}
Deals Closed: ${metrics.dealsClosed} ($${formatNumber(metrics.dealsClosed)})
Pipeline: $${formatNumber(metrics.pipelineValue)}
Win Rate: ${metrics.winRate}%
Avg Deal Size: $${formatNumber(metrics.avgDealSize)}
Avg Cycle: ${metrics.cycleTime} days
`;
await sendSlack(report);
Getting Started
Phase 1: Foundation (Week 1)
- Connect your CRM to n8n
- Set up form-to-CRM automation
- Implement basic contact sync
Phase 2: Enrichment (Week 2)
- Add Clearbit/Apollo enrichment
- Set up lead scoring
- Configure deal notifications
Phase 3: Advanced (Week 3-4)
- Meeting-to-CRM automation
- Pipeline automation with stage triggers
- Automated sales reporting
Ready to automate your CRM? Browse our CRM automation workflows and lead generation templates for pre-built solutions.
Share this article
Help others discover n8n automation tips and tricks
Related Articles

Automate Lead Generation with n8n: Complete Marketing Workflow Guide
Build automated lead generation systems with n8n. Capture leads from websites, social media, and ads. Qualify, score, and route leads to your CRM automatically. Full implementation guide.

n8n Workflow Templates: 15 Ready-to-Use Automations for Every Business
A curated collection of 15 battle-tested n8n workflow templates covering marketing, sales, operations, and engineering. Import, customize, and deploy in minutes.

The Complete n8n Node Guide: 30 Essential Nodes You Should Know
Master n8n's most powerful nodes. A practical reference guide covering triggers, actions, logic, AI nodes, and advanced node patterns. With real workflow examples for each node type.
