n8n + Salesforce Integration: 5 Workflows to Automate Your CRM
The n8n Salesforce integration gives you direct access to leads, contacts, opportunities, accounts, and custom objects — all through a visual workflow builder. Instead of paying for expensive Salesforce add-ons or writing Apex triggers, you can wire up automations in minutes using n8n's built-in Salesforce node. Whether you need to route inbound leads, keep your spreadsheets in sync, or send deal alerts to Slack, n8n handles it without writing a single line of code.
Why Automate Salesforce with n8n
Salesforce is powerful, but its built-in automation tools — Flow Builder, Process Builder, and Apex — come with steep learning curves and platform lock-in. n8n sits outside your Salesforce org and connects it to 400+ other services. That means you can build workflows that span Salesforce, Slack, Google Sheets, email providers, databases, and AI models in a single canvas.
Here's what makes n8n a strong fit for Salesforce automation:
- No per-user Salesforce license costs — n8n authenticates via a single connected app, so you don't need additional Salesforce seats for your automations
- Cross-platform workflows — trigger actions in Salesforce based on events in Stripe, HubSpot, Jira, or any API
- Full data control — self-host or use managed hosting like n8nautomation.cloud to keep your CRM data within your infrastructure
- No execution limits — unlike Salesforce Flow, which counts against your org's governor limits, n8n runs on its own compute
Connecting Salesforce to n8n
Before building workflows, you need to set up a Salesforce Connected App and configure OAuth credentials in n8n. Here's the process:
- In Salesforce Setup, navigate to App Manager and click New Connected App
- Enable OAuth Settings and add the scopes
api,refresh_token, andoffline_access - Set the callback URL to your n8n instance's OAuth callback path:
https://your-instance.n8nautomation.cloud/rest/oauth2-credential/callback - Copy the Consumer Key and Consumer Secret from the connected app
- In n8n, add a new Salesforce OAuth2 API credential, paste your key and secret, and click Connect
Tip: If you're using a Salesforce sandbox for testing, change the environment toggle to "Sandbox" in your n8n Salesforce credential settings. This points authentication to test.salesforce.com instead of login.salesforce.com.
Once connected, the Salesforce node gives you access to operations on Leads, Contacts, Opportunities, Accounts, Cases, Tasks, and Custom Objects — covering virtually every standard CRM workflow.
Workflow 1: Route New Leads Instantly
Slow lead response kills conversion rates. This workflow checks Salesforce for new leads every minute and routes them to the right sales rep based on territory, deal size, or product interest.
Nodes used:
- Schedule Trigger — runs every 60 seconds
- Salesforce node — operation:
Get Allon the Lead object, filtered byCreatedDate = TODAYandOwnerId = unassigned queue ID - Switch node — routes based on the
StateorCountryfield to match territory rules - Salesforce node — operation:
Updateon the Lead object, settingOwnerIdto the assigned rep's Salesforce user ID - Slack node — sends a message to the rep's channel: "New lead assigned: {{$json.Company}} — {{$json.Email}}"
The Switch node is where your routing logic lives. You can add as many output branches as you have territories. Each branch connects to its own Salesforce Update node with the correct owner ID hardcoded or pulled from a lookup table in Google Sheets.
Workflow 2: Sync Contacts Between Salesforce and Google Sheets
Many teams maintain a master contact list in Google Sheets for marketing, customer success, or executive reporting. This workflow keeps it current without manual exports.
Nodes used:
- Schedule Trigger — runs daily at 6:00 AM
- Salesforce node — operation:
Get Allon the Contact object with fields:Name,Email,Phone,Account.Name,LastModifiedDate - Google Sheets node — operation:
Read Rowsto fetch existing entries - Merge node — mode:
Combine By Matching Fields, matching onEmailto identify new and updated contacts - Google Sheets node — operation:
Append or Update Rowfor each matched/new contact
The Merge node is key here. By matching on email, you avoid duplicates and only update rows where Salesforce data has changed. For large orgs with thousands of contacts, add a WHERE LastModifiedDate >= YESTERDAY SOQL filter in the Salesforce node to limit the query to recently changed records.
Workflow 3: Slack Alerts for Opportunity Stage Changes
Sales managers need to know the moment a deal moves to "Negotiation" or "Closed Won." This workflow watches for stage changes and sends formatted Slack notifications.
Nodes used:
- Schedule Trigger — runs every 5 minutes
- Salesforce node — operation:
Get Allon Opportunity, filtered with SOQL:WHERE StageName IN ('Negotiation/Review','Closed Won','Closed Lost') AND LastModifiedDate >= LAST_N_MINUTES:5 - IF node — checks
StageNamevalue to determine the notification type - Slack node — sends a rich message to
#sales-pipelinewith the opportunity name, amount, stage, and owner
For Closed Won deals, you can extend this workflow with a branch that creates an invoice in Stripe or Xero, or triggers an onboarding sequence in your project management tool.
Workflow 4: Enrich Leads with AI Using n8n and Salesforce
Raw leads from web forms often have minimal data — just a name and email. This workflow enriches them automatically before a rep ever sees the record.
Nodes used:
- Webhook node — receives a POST request from your web form or Salesforce outbound message
- HTTP Request node — calls a company data API (like Clearbit or Apollo) with the lead's email domain to fetch company size, industry, and location
- OpenAI node — generates a lead summary: "Based on [Company] in [Industry] with [size] employees, suggest the best product tier and talking points"
- Salesforce node — operation:
Updateon the Lead object, writing enrichment data to custom fields (Company_Size__c,AI_Summary__c) - Slack node — notifies the assigned rep with the enriched lead profile
This is where hosting on n8nautomation.cloud pays off. Webhook-triggered workflows need your n8n instance running 24/7 with a stable URL. Managed hosting handles uptime, SSL, and backups so your lead enrichment never goes down.
Workflow 5: Automated Weekly Pipeline Reports
Instead of pulling Salesforce reports manually every Monday, this workflow generates a pipeline summary and delivers it to your inbox or Slack channel.
Nodes used:
- Schedule Trigger — runs every Monday at 8:00 AM
- Salesforce node — operation:
Get Allon Opportunity with SOQL:WHERE IsClosed = false AND CloseDate = THIS_QUARTER - Code node — aggregates the data: total pipeline value, deal count by stage, average deal size, and top 5 deals by amount
- OpenAI node — (optional) generates a natural-language summary of the pipeline state and week-over-week changes
- Gmail node — sends the formatted report to the sales team distribution list
The Code node handles the aggregation with a few lines of JavaScript:
const opps = $input.all().map(i => i.json);
const totalValue = opps.reduce((sum, o) => sum + (o.Amount || 0), 0);
const byStage = {};
opps.forEach(o => {
byStage[o.StageName] = (byStage[o.StageName] || 0) + 1;
});
const top5 = opps.sort((a, b) => b.Amount - a.Amount).slice(0, 5);
return [{ json: { totalValue, byStage, top5, dealCount: opps.length } }];
This gives your leadership team a consistent, automated view of the pipeline without anyone logging into Salesforce. You can extend it by storing weekly snapshots in a database to track pipeline trends over time.
Tip: Use n8n's built-in error handling to add an Error Trigger workflow that notifies you in Slack if any Salesforce workflow fails. This way you catch expired OAuth tokens or API limit issues before they affect your sales process.
These five workflows cover the most common Salesforce automation needs — lead management, data syncing, notifications, AI enrichment, and reporting. Each one runs reliably on a managed n8n instance at n8nautomation.cloud, starting at $15/month with no execution limits. Pick the workflow closest to your biggest time sink and build it first. Most take under 30 minutes to set up.