Sync MySQL accounts to Salesforce every 5 minutes
Recipe ToolsMarketingDatabaseCRMBotsArtificial IntelligenceSales Enablement
What it does
When the clock triggers every 5 minutes, this automation reads the upsert accounts table in MySQL and syncs each row to Salesforce. If an account exists, it updates the record; if not, it creates one, and posts a message to Slack if anything goes wrong.
Who it's for
Sales operations teams who need to keep Salesforce accounts in sync with a MySQL database without manual updates.
How teams use this
Keep Salesforce accounts current from MySQL
Run the sync every 5 minutes so any account added or changed in MySQL appears in Salesforce without delay. The team works in Salesforce while the database stays the source of truth.
Sync only accounts in a specific region
Filter the MySQL query to select only rows where the region matches a value, so only those accounts upsert to Salesforce. This keeps regional data separate and reduces unnecessary updates.
Alert the RevOps team on sync failures
Change the Slack channel or add a mention so the RevOps team gets notified when an account fails to upsert. The retry logic stays the same and only the notification target changes.
Include custom fields in the upsert
Map additional columns from MySQL to custom fields in Salesforce so each account syncs with more detail. The upsert logic stays the same and only the field mapping expands.
How it works
- Run on a 5-minute schedule. This automation starts every 5 minutes to check for new or updated accounts in the MySQL database that need to sync to Salesforce.
- Query the upsert accounts table. Retrieve all rows from the upsert accounts table in MySQL so each account can be synced to Salesforce in the next step.
- Upsert each account to Salesforce. For each row from MySQL, upsert the account in Salesforce so existing records update and new ones are created automatically.
- Notify on sync failure. If the upsert fails, retry once. If the error persists after retry, post a message to Slack so someone can investigate the issue.