How to Integrate SAP S/4HANA with Salesforce Using n8n

A step-by-step guide to connecting SAP S/4HANA and Salesforce with n8n, without MuleSoft or custom middleware. Covers OData setup, credentials, workflow design, and the most common sync use cases.

Share

TL;DR

SAP S/4HANA and Salesforce are the two most common enterprise systems in mid-market and large organizations. Connecting them traditionally meant MuleSoft, custom ABAP, or expensive middleware. n8n changes that. This guide walks through the exact steps to build a working SAP-Salesforce integration using n8n: OData service setup on the SAP side, REST API authentication on the Salesforce side, and practical workflow patterns for the most common sync scenarios.

Table of contents

Why this integration matters

SAP S/4HANA holds the operational core: inventory, procurement, finance, production orders, goods movements. Salesforce holds the customer-facing core: accounts, opportunities, quotes, service cases. When these two systems do not talk to each other, sales teams quote against stale inventory data, finance teams reconcile orders manually, and customer service reps cannot see delivery status without switching systems.

This is not a niche problem. According to Salesforce's own partner data, the majority of enterprise Salesforce deployments exist alongside an SAP system. The integration gap between them is one of the most common pain points in enterprise IT.

The business impact of closing it is direct: faster quote-to-cash cycles, fewer manual reconciliation errors, and customer service that can see the full order lifecycle in one place.

The traditional approach and its cost

The standard enterprise answer to SAP-Salesforce integration has been middleware: MuleSoft, Dell Boomi, SAP Integration Suite, or custom ABAP Remote Function Calls (RFCs). Each of these works, but comes with real costs.

MuleSoft licensing runs from $50,000 to over $200,000 per year depending on transaction volume and the number of connectors. SAP Integration Suite is similarly priced and assumes deep SAP expertise to configure. Custom ABAP is cheaper to license but expensive to build and nearly impossible to maintain without a dedicated SAP developer.

For mid-market companies, these costs put proper integration out of reach. The result is manual data entry between systems, CSV exports scheduled by someone's Outlook reminder, or a junior analyst who "keeps the two in sync" as an unofficial part of their job.

n8n offers a different model: open source, self-hostable, and priced on workflow executions rather than connector licenses. A mid-market company running several hundred thousand workflow executions per month pays a few hundred dollars. The same volume in MuleSoft would cost an order of magnitude more.

What n8n brings to SAP-Salesforce integration

n8n connects to SAP via its OData services (the standard API layer SAP exposes for external consumption) and to Salesforce via the native Salesforce node, which wraps the Salesforce REST API. Both connections are visual, version-controlled in n8n's workflow JSON, and testable without deploying code.

What makes n8n practical for this use case: it handles pagination, error retries, conditional logic, and data transformation natively in the workflow editor. You do not need a separate ETL tool. The workflow is the integration.

n8n can run as a scheduled job (polling SAP or Salesforce for changes on an interval), as an event-driven workflow (triggered by a Salesforce webhook or an SAP event), or as an API endpoint that other systems can call. All three patterns are useful for different parts of the SAP-Salesforce sync.

Step 1: Expose SAP data via OData

SAP S/4HANA exposes data through OData v2 and v4 services. These are the standard API layer for external integration. Before n8n can read from or write to SAP, the relevant OData service must be active and accessible.

In SAP S/4HANA, navigate to transaction /IWFND/MAINT_SERVICE (for OData v2) to see which services are active. For common integration objects, SAP ships pre-built OData services:

  • API_BUSINESS_PARTNER for customers and vendors
  • API_SALES_ORDER_SRV for sales orders
  • API_MATERIAL_DOCUMENT_SRV for goods movements
  • API_PRODUCT_SRV for material master data

If the service you need is not active, activate it via /IWFND/MAINT_SERVICE by searching for the service name and selecting "Add Selected Services." Your SAP BASIS team will need to handle this if you do not have admin access.

For authentication, SAP OData services support Basic Auth (username and password), OAuth 2.0, and SAP-specific token authentication. Basic Auth is the simplest starting point for a controlled environment. For production, use a dedicated technical user with the minimum permissions required for the objects you are syncing.

Test the connection directly before moving to n8n: call the OData service endpoint in a browser or Postman.

GET https://your-sap-host:443/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner?$top=5
Authorization: Basic [base64-encoded credentials]

If you get a JSON or XML response with business partner records, the service is working.

Step 2: Connect n8n to SAP

n8n does not have a dedicated SAP node, but the HTTP Request node handles OData services cleanly. Create a new credential in n8n of type "Header Auth" or "Basic Auth" with your SAP technical user credentials.

In your workflow, add an HTTP Request node with the following configuration:

  • Method: GET (for reading data) or POST/PATCH (for writing)
  • URL: your OData service endpoint
  • Authentication: the credential you created
  • Headers: add Accept: application/json to get JSON instead of XML
  • Query parameters: use $filter, $select, and $top to control what data returns

For reading customers modified in the last 24 hours, a filter looks like this:

$filter=LastChangeDateTime gt datetime'2026-06-17T00:00:00'&$select=BusinessPartner,BusinessPartnerFullName,EmailAddress

OData responses nest the actual records inside a d.results array. Add an n8n Code node after the HTTP Request to extract the array:

return items[0].json.d.results.map(record => ({ json: record }));

This gives you one n8n item per SAP record, which the rest of the workflow can process individually.

For paginated results (SAP returns a maximum of 1,000 records per request by default), use n8n's Loop Over Items node combined with the OData $skiptoken or $skip parameter to retrieve all records across multiple requests.

Step 3: Connect n8n to Salesforce

n8n has a native Salesforce node that handles OAuth 2.0 authentication automatically. In n8n credentials, create a new Salesforce credential and select either "OAuth2" (recommended for production) or "Username/Password" (simpler for testing).

For OAuth2, you need a Connected App in Salesforce:

  1. In Salesforce Setup, go to App Manager and create a new Connected App
  2. Enable OAuth settings and add the n8n callback URL (found in the n8n Salesforce credential setup screen)
  3. Select the scopes: "Manage user data via APIs (api)" and "Perform requests at any time (refresh_token, offline_access)"
  4. Save and wait a few minutes for the Connected App to propagate
  5. Copy the Consumer Key and Consumer Secret into n8n

Once connected, the n8n Salesforce node gives you access to standard objects (Account, Contact, Opportunity, Case, Order) and custom objects. You can create, update, upsert (create or update based on an external ID), and query records using SOQL.

For upsert operations, set an External ID field on the Salesforce object that maps to the SAP record's primary key. For example, on the Account object, create a custom field SAP_Business_Partner__c and mark it as an External ID. This lets you upsert Account records from SAP without checking first whether the record already exists in Salesforce.

Step 4: Build the sync workflow

A practical bidirectional sync between SAP and Salesforce covers three scenarios: new records in SAP that need to be created in Salesforce, updated records in SAP that need to be reflected in Salesforce, and records created or updated in Salesforce that need to be written back to SAP.

The simplest reliable pattern is a scheduled one-way sync from SAP to Salesforce, running every 15 or 30 minutes. Here is the workflow structure:

  1. Schedule Trigger: fires every 15 minutes
  2. HTTP Request (SAP): fetches business partners modified since the last run, using a timestamp stored in n8n's static data or an external store
  3. Code node: extracts and transforms the d.results array, maps SAP field names to Salesforce field names
  4. Salesforce node (upsert): upserts Account records using SAP_Business_Partner__c as the external ID
  5. Error handling: a catch branch that logs failed records to a Postgres table or sends a Slack alert
  6. Code node: updates the last-run timestamp for the next execution

For the reverse direction (Salesforce to SAP), the cleanest trigger is a Salesforce outbound message or a Platform Event that fires when a record changes. n8n can receive this via a Webhook node, transform the payload, and call the SAP OData service with a PATCH or POST request.

Common use cases

Customer master sync: SAP holds the authoritative customer record (billing address, payment terms, credit limit). Salesforce holds the relationship data (contacts, activities, opportunities). Syncing the SAP business partner to the Salesforce Account keeps sales teams working with current billing information without leaving Salesforce.

Order status sync: When a Salesforce opportunity closes and becomes an order in SAP, the delivery and invoice status from SAP should be visible in Salesforce. This lets customer service answer "where is my order?" without switching to SAP. A workflow that polls SAP for order status changes and updates a custom field on the Salesforce Opportunity or a related Order object handles this cleanly.

Product catalog sync: SAP holds material master data including pricing, availability, and units of measure. Surfacing this in Salesforce CPQ or a custom quoting object ensures sales reps quote from current catalog data rather than a spreadsheet someone exported last quarter.

Invoice and payment sync: SAP Finance generates invoices and tracks payments. Syncing invoice status to Salesforce gives account managers visibility into outstanding balances without needing SAP access.

Error handling and monitoring

Any integration that runs unattended needs error handling that does not silently fail. In n8n, add an Error Trigger workflow that catches failures from your sync workflows and sends a notification with the failed record details and the error message.

For records that fail consistently (invalid data, a field that exceeds Salesforce's character limit, an SAP record with a missing required field), log them to a dead-letter table in Postgres rather than retrying indefinitely. Review and fix these manually on a regular cadence.

Monitor execution times as your data volume grows. If your 15-minute sync starts taking 14 minutes to run, you need to either increase the interval, add parallelism with n8n's Split In Batches node, or reconsider the change-detection strategy (delta by timestamp is fast; full table scans are not).

When n8n is not enough

n8n handles the majority of SAP-Salesforce integration needs for mid-market companies well. There are scenarios where a more specialized tool makes sense.

If your integration involves high-frequency, high-volume transactional data (hundreds of thousands of records per hour), n8n's workflow execution model adds overhead that a streaming platform like Kafka or SAP Event Mesh handles more efficiently.

If you need complex ABAP business logic on the SAP side (custom validations, multi-step transactional processes that span SAP modules), a lightweight middleware calling SAP BAPIs or RFCs directly may be more appropriate than pure OData.

If your organization already has SAP Integration Suite licensed and staffed, using it for SAP-originated integrations while using n8n for lighter orchestration tasks is a reasonable split.

At Forest Digital, we design SAP-Salesforce integration architectures for mid-market and enterprise clients across Central and Eastern Europe, choosing the right tool for each layer of the integration. If you are evaluating options for your stack, reach out for a conversation.


Forest Digital is a digital transformation consultancy based in Košice, Slovakia, specializing in SAP, Salesforce, AI-driven development, and enterprise data platforms.