MySQL + Salesforce
Connect MySQL to Salesforce and Automate Your Data Workflows
Sync your relational database with your CRM in real time. No manual exports, no stale data, no engineering bottlenecks.
Why integrate MySQL and Salesforce?
MySQL and Salesforce sit at the center of most businesses — one holds raw operational data, the other drives sales and customer relationships. But keeping them in sync usually means painful manual exports, brittle custom scripts, or expensive middleware. With tray.ai, teams can automate bidirectional data flows between MySQL and Salesforce, keep every record accurate and current, and stop pulling developers into repetitive data-plumbing work.
Automate & integrate MySQL & Salesforce
Use case
Sync Customer Orders from MySQL to Salesforce Opportunities
When a new order lands in your MySQL database, tray.ai automatically creates or updates the matching Salesforce Opportunity with deal value, product line, and close date. Sales managers get real-time pipeline visibility instead of waiting on nightly batch jobs or manual CSV uploads.
Use case
Enrich Salesforce Leads with Product Usage Data from MySQL
Pull product usage metrics, subscription tier, and feature adoption data from MySQL and attach it to the right Salesforce Lead or Contact records. Reps can prioritize outreach based on actual usage signals rather than guesswork.
Use case
Write Salesforce Contact Updates Back to MySQL
When a sales rep updates a Contact's email, phone number, or account status in Salesforce, those changes automatically write to the matching row in your MySQL customer table. Your operational database and downstream applications stay current without any engineering involvement.
Use case
Automate Account Creation from MySQL Registration Events
When a new customer registers in your product and a record is inserted into MySQL, a Salesforce Account and Contact are created automatically with all the relevant attributes. Customer success and sales teams get notified right away and can kick off onboarding without waiting on a manual handoff.
Use case
Sync Salesforce Opportunity Stage Changes to MySQL for Reporting
As deals move through pipeline stages in Salesforce, stage change events write to a MySQL reporting table in real time. Finance and analytics teams can query live pipeline data directly without depending on Salesforce report exports.
Use case
Keep Product Catalog in Salesforce Synced with MySQL Master Data
Maintain your product catalog, pricing, and SKU data in MySQL as the master record and push updates to Salesforce Products and Price Books automatically. Sales reps always quote from current pricing — no IT ticket required to upload a new price book.
Use case
Alert Sales Teams on High-Value MySQL Events via Salesforce Tasks
When a customer hits a usage threshold or a subscription renewal is coming up, tray.ai creates a Salesforce Task assigned to the account owner. Sales and CSM teams act on time-sensitive signals without manually watching dashboards.
Get started with MySQL & Salesforce integration today
MySQL & Salesforce Challenges
What challenges are there when working with MySQL & Salesforce and how will using Tray.ai help?
Challenge
Handling Schema Differences Between MySQL Tables and Salesforce Objects
MySQL schemas and Salesforce object structures rarely match. Field names, data types, and relational structures differ in ways that make direct data transfer error-prone, and every integration ends up needing its own transformation logic.
How Tray.ai Can Help:
Tray.ai's visual data mapper lets you define field transformations, type conversions, and conditional logic between MySQL columns and Salesforce fields without writing code. Things like splitting a full name into first and last name fields, or converting Unix timestamps to Salesforce datetime format, are handled declaratively in the workflow builder.
Challenge
Avoiding Duplicate Records Across Both Systems
Without a solid deduplication strategy, bidirectional syncing quickly creates duplicate Contacts, Accounts, or Leads in Salesforce and orphaned rows in MySQL. Data quality degrades fast, and CRM reporting becomes unreliable.
How Tray.ai Can Help:
Tray.ai supports upsert operations using external ID fields in Salesforce, so every sync updates existing records rather than blindly creating new ones. You can configure lookup logic to match records by email, customer ID, or any unique key before deciding whether to insert or update.
Challenge
Respecting Salesforce API Rate Limits During Large Syncs
MySQL databases often hold millions of rows. Syncing large datasets to Salesforce without any rate management can exhaust API call limits within minutes, causing workflows to fail mid-run and leaving data in an inconsistent state.
How Tray.ai Can Help:
Tray.ai automatically manages Salesforce Bulk API usage for large datasets, chunking records into appropriately sized batches and spacing requests to stay within governor limits. Built-in retry logic ensures partial failures are retried without reprocessing records that already synced successfully.
Challenge
Keeping Bidirectional Sync from Creating Infinite Update Loops
When Salesforce changes trigger writes to MySQL, and MySQL changes trigger writes back to Salesforce, you can end up with circular loops where both systems endlessly overwrite each other. It causes instability and, eventually, data corruption.
How Tray.ai Can Help:
Tray.ai workflows support conditional branching and timestamp-based comparison logic that check whether a change actually originated in the source system before writing to the destination. Only genuinely new changes get propagated — updates don't just bounce back and forth.
Challenge
Managing Connectivity and Authentication to On-Premise or VPC-Hosted MySQL
Many MySQL instances run behind corporate firewalls, in private VPCs, or on-premise. That makes it hard for cloud-based integration platforms to connect reliably without complex network configuration or security trade-offs.
How Tray.ai Can Help:
Tray.ai connects to private MySQL instances through its on-premise agent and VPN tunnel options, so workflows can reach databases that aren't publicly exposed. Authentication credentials are stored in an encrypted secrets vault, keeping database access secure and centrally managed.
Start using our pre-built MySQL & Salesforce templates today
Start from scratch or use one of our pre-built MySQL & Salesforce templates to quickly solve your most common use cases.
MySQL & Salesforce Templates
Find pre-built MySQL & Salesforce solutions for common use cases
Template
New MySQL Row to Salesforce Record
Watches a specified MySQL table for new row inserts and creates or upserts a corresponding record in a Salesforce object — Contact, Account, Lead, or Opportunity. Field mapping is fully configurable to match your schema.
Steps:
- Poll MySQL table on a schedule or trigger on INSERT event for new rows
- Transform and map MySQL column values to Salesforce field schema
- Upsert record in Salesforce using an external ID to prevent duplicates
Connectors Used: MySQL, Salesforce
Template
Salesforce Contact Updated — Sync to MySQL Customer Table
Listens for Salesforce Contact update events via outbound messaging or polling and writes changed field values back to the matching row in a MySQL customer table, keeping operational data consistent with CRM changes.
Steps:
- Detect Contact field change in Salesforce via polling or webhook
- Lookup matching MySQL record using a shared unique identifier
- Execute UPDATE query on MySQL table with new field values
Connectors Used: Salesforce, MySQL
Template
Nightly MySQL-to-Salesforce Bulk Sync
Runs on a nightly schedule to query MySQL for all records modified in the last 24 hours, then batch-upserts them into Salesforce. You get daily consistency between your database and CRM without the complexity of a real-time sync.
Steps:
- Query MySQL for rows where updated_at is within the last 24 hours
- Chunk results into Salesforce-safe batch sizes to respect API limits
- Bulk upsert records into the target Salesforce object
Connectors Used: MySQL, Salesforce
Template
Salesforce Opportunity Won — Write Order to MySQL
When a Salesforce Opportunity is marked Closed Won, a new order record is automatically inserted into MySQL with deal value, products, account ID, and close date. This bridges the gap between CRM and your order management or fulfillment systems.
Steps:
- Trigger on Salesforce Opportunity stage change to Closed Won
- Fetch related Opportunity line items and Account details from Salesforce
- Insert structured order record into the MySQL orders table
Connectors Used: Salesforce, MySQL
Template
MySQL Usage Threshold Alert to Salesforce Task
Queries MySQL on a schedule for customers who've crossed a defined usage or subscription threshold and creates a Salesforce Task assigned to the account owner, prompting timely upsell or renewal outreach.
Steps:
- Run scheduled MySQL query to identify customers meeting threshold criteria
- Look up corresponding Salesforce Account and assigned owner
- Create a Salesforce Task with context details and a due date
Connectors Used: MySQL, Salesforce
Template
Sync Salesforce Price Book to MySQL Product Catalog
Pulls active products and pricing from Salesforce Price Books on a schedule and updates the matching rows in a MySQL product catalog table, so downstream applications always reflect the latest approved pricing.
Steps:
- Query Salesforce for active Price Book entries and product details
- Compare retrieved data against existing MySQL product catalog rows
- Insert new products and update changed pricing in MySQL
Connectors Used: Salesforce, MySQL