SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Twilio for Salesforce - Messages Not Syncing

Issue

The most common issue with Twilio for Salesforce is message synchronization failures, where messages sent or received via Twilio do not appear in Salesforce as TwilioSF_Message__c objects. This typically occurs because the sync job (a batch process) fails to fetch and create message records.

Product

Twilio for Salesforce

Causes

Salesforce API Limitations: Salesforce is not designed for real-time messaging, and sync jobs may fail due to rate limits or performance bottlenecks.

Large Volume of Messages: Excessive message volume can overwhelm the sync process, especially when the process in run in short intervals (e.g., 1 minute).

Configuration Errors: The sync job responsible for fetching messages might error out due to configuration issues.

Resolution

Twilio provides support only for the latest version of the application. To view the current app version, please visit Twilio for Salesforce Changelog.

1. Check your message sync frequency:

Open Twilio from the Salesforce App Launcher → Navigate to the Twilio Configuration pane → Scroll down to the Message sync section. You will see the option to change the message syncing interval. Extending this interval (from 1 minute to 10-15 minutes) may help the sync job succeed. This is especially true if you have a large number of messages.

Try stopping the current job, waiting a few seconds, and then scheduling the next one. You can then monitor your Apex logs to see if the sync job succeeds. 

2. Monitor your Apex Jobs:

Twilio for Salesforce sync jobs are represented as Apex job logs in Salesforce. There are two jobs relevant to message syncing.  

  • TwilioGetMessagesScheduler: This is the scheduler job that triggers the message sync process. If it shows a status of "Aborted", this is expected. It means an existing TwilioMessageQueue job is already running and another scheduler job is not needed.
  • TwilioMessageQueue: This is the actual job that fetches messages from Twilio.

Monitor these jobs via Setup → Apex Jobs

Filter by the job names (TwilioGetMessagesScheduler or TwilioMessageQueue) and review the status for any error messages in the Job Details section.

3. Adjust Message Batch Size via Custom Settings:

This setting controls how many messages are fetched in a single api call from Salesforce. You can set a range of 100–1000 messages per batch. Reducing the batch size can help avoid API rate limits or performance issues during large syncs. Change this option under Setup → Custom Code → Custom settings → Manage Twilio Public App Config.

4. Another option would be to disable the Sync failure email notification:

If you are receiving "Sync Job Failed" emails but not seeing any messages actually failing, you may want to disable the warnings. To do so, navigate to the Twilio SF custom settings and check the box for 'Stop Sync Job Failure Notification'.

5. Reach out to Salesforce support:

Sometimes these jobs can fail for reasons outside the control of Twilio or the Twilio for Salesforce package. For example, you may be rate limited by Salesforce or running out of Apex Job capacity. You may want to reach out to Salesforce support to determine if they have any other insights or solutions.

Additional Information

 

Have more questions? Submit a request
Powered by Zendesk