Gifts

Culture

Reviews

Local Spots

How to Setup Salesforce with n8n (2026 Guide)

Salesforce

★★★★ 4.5
Crm Enterprise Crm

The world's leading cloud-based CRM platform powering sales, service, and marketing for businesses of all sizes.

Full Review

n8n

Open-source workflow automation tool with self-hosting options.

All n8n Tools

Overview

n8n provides a powerful Salesforce integration node that enables automated workflows between Salesforce and hundreds of other applications. The open-source nature of n8n makes it particularly attractive for Salesforce users because Salesforce already imposes API call limits, and n8n's self-hosted option lets you run unlimited workflow executions without additional per-execution costs. This combination helps organizations stay within Salesforce API limits while building sophisticated automations.

The n8n Salesforce node supports all standard and custom objects, SOQL queries, record creation, updates, deletions, and attachments. Workflows can be triggered by Salesforce events via webhooks or by polling for changes on a schedule. n8n's code nodes support JavaScript and Python, which is valuable for the complex data transformations that Salesforce integrations often require, such as mapping picklist values, handling record type logic, or processing related records.

n8n is a strong choice for Salesforce integrations in organizations with technical teams who value control, transparency, and the ability to self-host. For teams without technical resources, cloud-based alternatives like Make or Zapier may offer a smoother experience.

Prerequisites

  • An n8n instance (self-hosted or n8n Cloud)
  • A Salesforce edition with API access (Enterprise, Unlimited, Developer, or Performance)
  • A Salesforce Connected App configured for OAuth 2.0
  • A dedicated Salesforce integration user with appropriate profile and permissions
  • For self-hosted n8n: a publicly accessible HTTPS endpoint for webhook-based triggers

Step-by-Step Setup

Step 1: Create a Connected App in Salesforce

In Salesforce, navigate to Setup > App Manager. Click New Connected App. Enter a name (e.g., "n8n Integration"), contact email, and check Enable OAuth Settings. Set the callback URL to your n8n instance URL followed by /rest/oauth2-credential/callback. Select the required OAuth scopes: Full access (full) or individual scopes like Manage user data via APIs (api) and Perform requests at any time (refresh_token, offline_access). Click Save and wait a few minutes for the app to propagate.

Step 2: Retrieve Connected App credentials

After saving, go to App Manager, find your new app, and click View. Under API (Enable OAuth Settings), click Manage Consumer Details. Copy the Consumer Key and Consumer Secret. You will need these in n8n.

Step 3: Add Salesforce credentials in n8n

In n8n, go to Credentials > Add Credential. Search for "Salesforce" and select it. Choose OAuth2 as the authentication type. Paste the Consumer Key and Consumer Secret from Step 2. Set the environment to Production or Sandbox. Click Connect to initiate the OAuth flow. Log in to Salesforce and authorize the connection.

Step 4: Create a workflow with the Salesforce node

Create a new workflow in n8n. Add the Salesforce node and select your credential. Choose the resource (Lead, Contact, Account, Opportunity, Task, or Custom Object) and the operation (Get, Get All, Create, Update, Delete, or Upsert). For the Get All operation, you can add SOQL conditions to filter records.

Step 5: Configure trigger or schedule

For scheduled workflows, use the Schedule Trigger node to run the workflow at specified intervals. For event-driven workflows, use the Webhook node and configure Salesforce Outbound Messages (under Setup > Workflow Rules > Outbound Messages) to send data to your n8n webhook URL when records are created or updated.

Step 6: Test and debug

Click Test Workflow to execute with live Salesforce data. Review input and output for each node. Verify that Salesforce records are being read correctly and that write operations create or update records as expected. Check Salesforce to confirm the data appears correctly.

Step 7: Activate the workflow

Toggle the workflow to Active. Monitor the execution log for the first few hours to catch any edge cases or errors. n8n's execution history shows detailed logs for every run, including data at each step.

Configuration Options

The Salesforce node's Upsert operation uses an external ID field to match records, which is the best approach for bidirectional sync scenarios. Use the Additional Fields parameter to specify which Salesforce fields to include in queries, reducing API response size. The Code node handles complex field mappings, picklist value translations, and data transformations between Salesforce and external systems. n8n's IF node enables routing based on Salesforce record types, stages, or any field value.

What Syncs

DataDirectionFrequency
LeadsBidirectionalReal-time (webhook) or scheduled
ContactsBidirectionalReal-time or scheduled
AccountsBidirectionalReal-time or scheduled
OpportunitiesBidirectionalReal-time or scheduled
Tasks and EventsBidirectionalScheduled
Custom ObjectsBidirectionalScheduled

Best Practices

  • Create a dedicated Salesforce integration user with a specific profile to isolate API permissions and track API usage
  • Use Salesforce's Bulk API (via n8n's HTTP node) for operations involving more than 200 records to conserve standard API limits
  • Implement idempotency using external ID fields to prevent duplicate records during retries
  • Add a Wait node between Salesforce API calls to respect rate limits (100 calls per 15 seconds)
  • Store Salesforce field mappings in n8n's static data or a configuration node so changes do not require editing the main workflow
  • Use n8n's execution data retention settings to comply with data retention policies for Salesforce data

Common Issues and Fixes

INVALID_SESSION_ID or authentication errors

OAuth tokens expire periodically. n8n should handle token refresh automatically, but if authentication fails persistently, delete and recreate the Salesforce credential in n8n. Also verify that the Connected App in Salesforce has not been deactivated or had its policies changed.

Record type errors on creation

If your Salesforce org uses record types, the Create operation may fail if the default record type is inactive or restricted for the integration user's profile. Specify the RecordTypeId explicitly in the node's additional fields to control which record type is used.

Governor limit exceeded

Salesforce enforces governor limits on API calls, query rows, and processing time. For high-volume workflows, use batch processing with the Split In Batches node. For large queries, add LIMIT and OFFSET clauses to SOQL queries to paginate results rather than pulling all records at once.

Advanced Configuration

Use n8n's HTTP Request node to access Salesforce's Composite API, which lets you perform up to 25 operations in a single API call. Implement Salesforce Platform Events as triggers by subscribing to the Streaming API through n8n's webhook infrastructure. Build sub-workflows for common Salesforce operations (lead assignment, opportunity stage updates) and call them from multiple parent workflows. For complex org structures, use n8n's environment variables to manage multiple Salesforce orgs (production, sandbox, partner orgs) from a single n8n instance.

Salesforce Full Review » | All n8n Tools »