Upserting Records in Salesforce Flow: Benefits, Challenges and Best Practices
In Salesforce Flow, data elements help you work with records in the database. You can use them to get, create, update, or delete records. Most of the time, these options are enough, but sometimes you may need to upsert records—meaning update existing ones or create new ones if they don’t exist.
Salesforce Flow doesn’t have a specific Upsert Records option, but you can still do this using the Create Records element.
How to Upsert Records in Flow?
When using the Create Records element to add multiple records, you can turn on the Update Existing Records option. This helps Salesforce check if a record already exists:
To find existing records, Salesforce uses one of these three options:
What should you do if creating or updating a record doesn’t work?
Before, Salesforce Flow used an all-or-nothing approach. This meant that if you tried to create multiple records at once and even one failed, all records would be canceled.
With the Winter '25 release, Salesforce introduced the partial success option in the Create Records element. Now, if some records fail, you can choose to:
This option works only in the Create Records element, but since this element also supports upserting (updating or creating records), you can use partial success for updates as well. If the records already exist, Salesforce will update them instead of creating new ones.
Selecting the "Process successful records. Create or update only the records that are successful." option enables partial success in Salesforce Flow. This means that if some records fail, the rest will still be processed.
For example, if you try to create or update 100 records and 10 fail due to errors (such as missing required fields or validation rules), the remaining 90 records will still be successfully processed.
Similarly, if you're importing 500 customer records and 20 contain incorrect email formats, only those 20 will fail, while the other 480 will be created or updated as expected.
Recommended by LinkedIn
Limitations of Partial Success Output
While upsert records and partial success options are helpful, their output can feel incomplete.
To overcome these challenges, consider logging failed records separately or using additional automation to track processing results.
Example
Imagine we have a Flow that upserts three Case records:
Below is the configuration used in this example.
In this example, one of the three records failed due to a validation rule, and the error message is visible in the debug details.
As you can see, there is no output indicating which specific record failed. Since partial success was enabled, the remaining two records were successfully created or updated. However, there is no way to determine whether both records were newly created or if one was created and the other was updated.
Now, imagine processing hundreds of records—how would you track which ones succeeded and which ones failed?
Additionally, even though two records were processed successfully, the Create Records element still failed because of the single failed record. As a result, the flow did not proceed with the remaining steps.
While partial success can be beneficial in certain situations, its limitations should be carefully considered before enabling it in your Flow.