Integration
- Follow the steps in Set up MoEngage app on Salesforce to install and configure the MoEngage app from the Salesforce AppExchange.
Scope
Steps
The integration is divided into two major steps:- Connections: A Connection is the authorization to your MoEngage workspace. You can connect multiple MoEngage workspaces to a single Salesforce instance.
- Syncs: A Sync is a job that runs in real time to send specific data between the two systems. It includes the sync type (MoEngage to Salesforce or Salesforce to MoEngage), the entities to sync, and the data mapping.
Launch the MoEngage app
Click App Launcher, enter MoEngage, and then select MoEngage App.
Step 1: Set up a connection
Add a new connection

Enter your MoEngage workspace details

Save the connection
Step 2: Set up a sync
For this guide, we use the example of syncing Salesforce Contacts to MoEngage as users. Follow a similar process for event syncs.Sync Salesforce Contacts to MoEngage as users
Open Map Fields

Add a new sync

Enter basic sync details

Continue
Configure data mapping
- Define the identifier between the two systems. For MoEngage, the identifier name is Customer ID — it can be mapped to any field on the Contact object.

- Set up mappings for other fields. Enter the MoEngage attribute (these appear as user attributes in MoEngage) and select the Salesforce field to map it to.

- Click Save.

Errors when deploying triggers
If your initial trigger deployment fails, it is often due to custom validation rules on the Salesforce object you are syncing (for example, rules on the Contact or Lead object). To deploy successfully, the system needs to create a test record, and that test record must pass your organization’s validation rules. When the deployment fails, a modal appears asking you to provide test data:
Analyze the snippet
Add your custom fields
LastName and the correct format of Email, modify the sample line to:
Formula fields
- Salesforce does not detect underlying data changes for mapped formula fields.
- A change only in the formula’s calculated output does not trigger a sync.
Compound fields
- Do not map compound address or location fields (for example,
MailingAddress) directly. - Instead, map their individual components:
MailingStreetMailingCityMailingStateMailingPostalCodeMailingCountry
- This ensures accurate syncing with the corresponding MoEngage attributes.
Step 3: View profiles in MoEngage
Create a segment
Search for the user
Sync real-time updates
By default, new sync configurations are automatically enabled for real-time updates. Any modification to a mapped field on an existing record within the synced Salesforce object triggers an update to MoEngage. To deactivate real-time syncs, click Deactivate next to the sync.Field change detection
- Real-time sync is triggered when a mapped object record is created or when an existing record has at least one mapped field changed.
- Updates to unmapped fields alone do not trigger a sync to MoEngage.
Sync historical data
You can trigger a historic sync of your existing data at any point. This is useful when you want to backfill data in MoEngage.Performing a historic sync
Click Sync

Adjust the batch size (optional)

Start the historic sync
Monitoring the historic sync
After starting a historic sync, track its progress by observing the status displayed next to the sync configuration.

Check the Salesforce Apex Flex Queue
HistoricalSyncBatch. If you find it in this state, you can reorder the batch to prioritize MoEngage.Verify the batch has started
HistoricalSyncBatch Apex class, the batch has started processing.Check the Apex Jobs Queue
HistoricalSyncBatch Apex class. You can also search using the Last Historic Sync Apex Batch Job ID of the related sync.
Important points to remember
- One sync per entity type: You can only run one historic sync at a time per MoEngage entity type (one for Users and one for Events).
- Example: Suppose Salesforce Contacts and Leads are both mapped to MoEngage Users, while Salesforce Opportunities and Deals are mapped to MoEngage Events. If you start a sync for Contacts (a User sync), you cannot start another sync for Leads until the first one completes. However, while the Contacts sync is running, you can still start a sync for Opportunities or Deals because they are mapped to a different entity (Events).
- Manual refresh required: The sync status does not update automatically. Click the Refresh icon or manually refresh the page to see the latest status.
- Status of last sync: The status shown always reflects the outcome of the most recent sync attempt for that specific configuration.
- New sync start: You can start a new historic sync only when the status of the most recent sync for that specific configuration is not Sync Scheduled or Sync Processing.
Sync queues
To ensure your data syncs reliably and efficiently, the MoEngage app processes all transfers through an intelligent Sync Queue. This system automatically optimizes performance, minimizes errors, and uses smart logic to retry failed attempts. Every sync (historic or real-time) is managed through this queue. Visit the Sync Queue to monitor the status of all your jobs — from scheduled and active to completed. By default, Sync Queue includes two views: Real Time Syncs and Historical Syncs.Activating Sync Queue views
Activating Sync Queue views
Open Setup
Open Object Manager
Open Sync Queue
Open Lightning Record Pages
Open Sync Queue Record Page
Activate the page
Assign as Org Default
Choose Desktop
Save


Failed sync queues
These are subsequent Sync Queue records created for records that have failed to previously sync and will be retried in the future.Exceptions

How real-time sync works
On create
- When a new record is created on an object with active mappings, MoEngage generates one Sync Queue record per active connection for that object.
- For example: if two connections map to Contact, then creating a single Contact record generates two Sync Queue records that are both sent to MoEngage.
On update
- A Sync Queue record is created only if at least one mapped field changes.
- Updates to non-mapped fields do not create Sync Queue records.
Processing
- When a real-time sync is triggered, MoEngage runs a
MoEngageSyncQueueBatchin the background, which picks up pending real-time syncs and processes them together. - The default batch size comes from Sync Queue Batch Size (default:
20). - New records added or updated while a batch is running are processed in the next iteration.
- If the Flex Queue is full, processing is rescheduled using Sync Queue Scheduler Time (default:
5minutes). - The “full” threshold is configurable via Flex Queue Limit (default:
50).
Historical syncs
- A historic sync is added to the Sync Queue as soon as it is scheduled.
- If the Salesforce Flex Queue is full, historical sync jobs are rescheduled after the delay set in Historical Sync Scheduler Time (default:
5minutes).
Processing
- If a few records of the historical sync fail, related exception records and Sync Queue records are created.
- For each historic sync, click on the Sync Queue record and view its failed records and related exceptions. You can also manually trigger a retry if an automatic retry is not possible.
Error handling
Certain errors cause the batch to abort and require different retry approaches:- Authentication Required → Batch aborts; requires manual retry.
- BlockedClient → Batch aborts; requires manual retry.
- Account Suspended → Batch aborts; requires manual retry.
- Unsupported Media Type → Batch aborts; requires manual retry.
- Server Error → Batch aborts but is automatically retried (within retry limits).
Retries
- Each queue item allows up to 4 automatic retry attempts (including the first attempt).
- No automatic retries occur for the following errors (these require user action):
- Account Suspended
- Authentication Required
- BlockedClient
- MissingAttributeError — occurs if the record does not have a value for Customer ID.
- If a payload error occurs, the batch size is halved on each retry until either:
- The batch succeeds, or
- The size reduces to 1.
Manual retry

- Manual retry for real-time sync applies only to the current Sync Queue record.
- MoEngage returns a clear success or failure response.
- The Retry button is available only to users with the MoEngage Admin Permission set.
- The Manual Retry option becomes visible when all the following conditions are met:
- Condition A: Status = Failed or Partial Success, Retries ≥ 4, and Sync Status = Active.
- Condition B: Error Type is one of
Account Suspended,Authentication Required,BlockedClient, orMissingAttributeError.
Behavior
- Real-time sync:
- Attempts to sync immediately.
- Updates the record with success or failure.
- Increments the Retries count if it failed.
- Logs an exception if the retry fails.
- Manual retry for real-time syncs works only on the current Sync Queue record and returns a success or failure response.
- Historical sync:
- Schedules the historical batch job.
- Displays a Scheduled response to confirm the action.
Rate-limit behavior
Real-time sync behavior
- Processing for the affected connection or object is paused.
- Syncs automatically resume after the back-off sequence once limits clear.
Historical sync behavior
- The running batch is aborted immediately.
- Back-off retries follow the sequence: 1 → 2 → 4 → 8 → 10 minutes.
- Any new historical syncs for the same connection or object remain in the Scheduled state.
- The retry count for historical syncs is automatically reset to 0 once the configured limits are cleared.
Delete processed syncs
Scheduling
- On install or upgrade, MoEngage automatically schedules the Delete Processed Syncs job to run daily at 1:00 AM.
- You can adjust this schedule under Setup > Scheduled Jobs.
What it does
- Deletes successful Sync Queue records (and their related failed queues and exceptions) that are older than the Record Deletion Interval (default:
7days). - Cleanup is based on the Last Modified Date field.
Admin note: Package install limitation
- If the packaging user does not have full access to run the schedule under the desired context, the job may fail to execute properly.
- Solution: Reschedule the job under an admin user to ensure it runs with proper privileges.
Steps to reschedule the delete job
Steps to reschedule the delete job
Open Scheduled Jobs
Open the job
Manage the job
Update the cron expression (optional)
Reschedule the job
Frequently asked questions
Can I apply filters on my data sync?
Can I apply filters on my data sync?
How do I enable real-time syncs?
How do I enable real-time syncs?