BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
165 / 1048 · Module 5 — Salesforce Data Model + SOQL← prev⊞ allnext →

5.47Scenario 6 — incremental Mule job

Every 15 minutes:

Scheduler
 ↓
read lastSuccessfulSync
 ↓
Salesforce Query
 ↓
process changed Accounts
 ↓
upsert downstream
 ↓
store watermark

SOQL:

SELECT
    Id,
    Name,
    External_Customer_ID__c,
    LastModifiedDate
FROM Account
WHERE LastModifiedDate > :lastSuccessfulSync
ORDER BY LastModifiedDate

But immediately ask:

What if records have exactly the same timestamp?

What if Mule crashes halfway?

What about deleted records?

What about overlap?

Can downstream processing safely repeat?

That's why integration design is much more than writing a query.