
MuleSoft
Configure a MuleSoft Salesforce upsert and verify record-level outcomes for a partially successful batch.
- Carry each key
- Configure the connector’s External Id Field Name.
- Capture row failures
- Record the three failed keys separately from 497 valid writes.
- Read On Complete
- Confirm how the job report matches the per-key outcomes.
A nightly MuleSoft batch writes 500 billing contacts to Salesforce. Two have bad parent keys and one has an invalid country code. Track per-record results so the 497 valid writes remain visible if the run reports errors.
Set the batch’s failure policy before loading
In a Mule application with a Salesforce connector, carry the source key in each batch record and configure the connector’s Upsert operation with its External Id Field Name. Confirm the operation’s record result structure. Handle failed Salesforce results in your flow and retain the row key. A response that contains a failed row needs handling even if the integration received a response successfully.
In the Batch Job, set maxFailedRecords for the business decision. Mule’s default is zero. If the finite limit is exceeded, the instance stops and reports the failed-record condition. Use the On Complete phase for the run’s report and keep per-key dispositions separately. In this example, the policy allows three row problems so operations can reconcile them afterward.
Verify the job result and every exception
| Outcome | Expected evidence | Next action |
|---|---|---|
| 497 valid contacts | One recorded Salesforce result per source key. | Sample destination IDs and parent links. |
| Three invalid contacts | The failure log has the individual keys and source field errors. | Repair the account crosswalk or allowed country code and replay only affected rows. |
| Failure threshold exceeded in a second test | The instance stops and the report shows a failed condition. | Reconcile input, completed and unprocessed keys before any retry. |
Repeat a known accepted key against the sandbox to confirm the upsert targets the previous record. The reconciliation guide covers how to report what each key still needs.