Prompt
How do I sync data between my app and Salesforce?
Latest observation
Oct 1, 2026
OpenAI APIWeb search: off
To sync data between your app and Salesforce, you generally need to decide what kind of sync you want:
- One-way sync
- Your app → Salesforce, or Salesforce → your app
- Two-way sync
- Changes in either system update the other
- Real-time vs scheduled
- Real-time: updates happen immediately
- Scheduled/batch: updates run every few minutes or hours
Common ways to sync with Salesforce
1. Use Salesforce APIs
This is the most flexible approach.
- REST API: best for most CRUD operations
- Bulk API: best for large data loads
- SOAP API: older, still used in some enterprise setups
- Composite API: useful for reducing round trips
- GraphQL API: if available in your org/use case, good for fetching structured data
Typical flow:
- Authenticate with Salesforce using OAuth 2.0
- Query or update records using the API
- Track record IDs and timestamps to detect changes
2. Use Change Data Capture or Platform Events
If you need near real-time syncing:
- Change Data Capture (CDC): Salesforce publishes record changes
- Platform Events: custom event-driven integration
- Your app subscribes and reacts to changes
This is ideal for:
- near real-time updates
- event-driven architectures
- reducing polling
3. Use Salesforce outbound/inbound integrations
Depending on your architecture:
- Outbound messages from Salesforce to your app
- Apex callouts from Salesforce to your backend
- Custom REST endpoints in your app that Salesforce calls
4. Use middleware / iPaaS
If you want less custom code:
- MuleSoft
- Workato
- Zapier
- Boomi
- Informatica
- Make
These can help with mapping, retries, monitoring, and transformations.
Recommended architecture for most apps
For simple sync
- Authenticate with OAuth
- Use REST API
- Store Salesforce record IDs in your app
- Use
lastModifiedDateor a custom sync field to detect changes - Run scheduled jobs to reconcile
For real-time sync
- Use CDC or Platform Events from Salesforce
- Have your app process events
- Use REST API to write back changes when needed
For two-way sync
- Define a source of truth for each field or object
- Keep a sync mapping table:
- app record ID
- Salesforce record ID
- last synced timestamp
- version/hash
- Use conflict resolution rules:
- latest update wins
- Salesforce wins
- app wins
- manual review for conflicts
Key things to get right
Authentication
Most integrations use:
- Connected App
- OAuth 2.0
- refresh tokens or JWT bearer flow for server-to-server auth
Data mapping
Map your internal objects to Salesforce objects like:
- Account
- Contact
- Lead
- Opportunity
- Custom objects
Sync strategy
Decide:
- what fields sync
- which system is authoritative
- how to handle deletes
- how to handle duplicates
Error handling
Build in:
- retries with backoff
- dead-letter queue or error log
- idempotency to prevent duplicate writes
- monitoring/alerts
Rate limits
Salesforce has API limits, so:
- batch requests when possible
- avoid excessive polling
- cache results where appropriate
Example approach
If your app has customer records and you want to sync to Salesforce:
- Create a Connected App in Salesforce
- Authenticate your backend via OAuth
- Create or update an
Account/Contactusing REST API - Save the Salesforce record ID in your database
- Use webhook/event handling or scheduled sync to detect changes
- Resolve conflicts and update the other system
If you want a practical implementation
I can help you with any of these:
- a Node.js / Python / Java example
- OAuth setup for Salesforce
- real-time sync using CDC
- two-way sync design
- schema mapping for your app’s objects
- middleware recommendation
If you tell me:
- your app stack
- whether you want one-way or two-way sync
- what objects you need to sync
…I can give you a concrete implementation plan.