
Data elements in Flow allow you to interact with records in the Salesforce database. You can use them to retrieve, create, update, and delete Salesforce records. While these data elements are sufficient for most situations, there may be times when you need to upsert records as well. Although Flow does not have a dedicated Upsert Records element, you can achieve this using the Create Records element.
How to Upsert Records in Flow
When using the Create Records element to create multiple records from a record collection, you can enable the Update Existing Records option. This performs an upsert operation, which means updating existing records if they already exist and inserting new ones if they don’t.
There are 3 options to identify existing records.
- Record ID: Use the Salesforce record ID to identify the record.
- External ID: Select an external ID field from the record. This external ID field must be set as unique.
- Standard Field: Select a field with its idLookup property equal to true. For example, CaseNumber.

What to do if a create or update fails?
Previously, all data elements in Salesforce Flow operated on an all or nothing basis. This meant that if you attempted to create multiple records at once and even one failed, all the records would be rolled back. However, in the Winter '25 release, Salesforce introduced the partial success option in the Create Records element. Now, if a record fails to be created or updated, you can choose whether to proceed with the remaining records in the collection or roll back everything.
The partial success option is available only in the Create Records element. However, because this element supports upserting records, you can also use partial success when updating records. For example, if you need to update records, you can use the Create Records element and enable the Update Existing Records option to upsert them. Since all the records already exist in Salesforce, the Create Records element will update them instead of creating new ones.

Choosing the "Process successful records. Create or update only the records that are successful." option enables partial success. For example, if you attempt to create or update 100 records and 10 of them fail for any reason, the remaining 90 records will still be processed successfully.
Output of Partial Success
Although the upsert records and partial success options are useful, the output of partial success may seem incomplete.
If some records fail, the element itself fails as well, even though the remaining records are processed successfully. To handle this, you may want to use a fault path to ensure your flow continues smoothly.
Additionally, this element does not provide an output to indicate which records succeeded and which ones failed. This limitation can lead to missing or incomplete data tracking.
Example
Let's assume we have a Flow that upserts three Case records; two new records and one existing record. 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 we enabled partial success, the remaining two records were created or updated successfully. But again, we have no way of knowing whether the flow created two new records or created one and updated one. Now imagine handling hundreds of records. How would you track which ones failed or succeeded?
Furthermore, even though two records were processed successfully, the Create Records element itself failed because of the single failed record. As a result, the flow did not continue with the remaining elements.
While partial success can be useful in some cases, its limitations require careful consideration before enabling it in your Flow.
Leave a Reply