We’re experiencing failures in our automated contact creation Flow during bulk imports. The Flow runs fine for individual contacts but fails when processing batches of 50+ records.
The error message we’re getting:
UNABLE_TO_LOCK_ROW: unable to obtain exclusive access
Duplicate Rule: Standard_Contact_Duplicate_Rule
Our Flow uses the “Create Records” element with duplicate rule settings, but it seems the bulk import triggers the duplicate check differently than single record creation. About 30% of contacts get created successfully, then the Flow fails.
We’ve configured the duplicate rule to allow saves but alert users. The Flow’s error handling branch isn’t catching these errors properly during bulk operations. Has anyone dealt with duplicate rule configuration issues in Flow Builder for bulk data import scenarios?
Your Flow needs a comprehensive fix addressing all three areas you mentioned. Here’s the solution:
Duplicate Rule Configuration:
Navigate to Setup > Duplicate Rules and modify your Standard_Contact_Duplicate_Rule:
Set Action on Create to “Allow” instead of “Block”
Enable “Bypass sharing rules” if your Flow runs in system context
Consider making the rule report-only during bulk imports
Bulk Data Import with Flow:
In your Flow’s Create Records element, configure these settings:
How to Handle Duplicates: Use Duplicate Rules
Allow Partial Success: TRUE
This is critical - without “Allow Partial Success”, one duplicate failure kills the entire batch. With it enabled, successful records are committed and only duplicates are handled by your fault path.
Error Handling in Automation:
Implement a proper fault path:
Add a Fault Connector from your Create Records element
Route it to a Decision element that checks {!$Flow.FaultMessage} contains “UNABLE_TO_LOCK_ROW” or “DUPLICATE”
For duplicate errors, route to a Collection variable that stores failed records
For lock errors, add a Pause element (2 seconds) then retry the Create Records
Log all failures to a custom object for later review
The key insight: duplicate rules in bulk operations need async processing or partial success handling. Your 30% success rate suggests the Flow is dying mid-batch when it hits the first lock contention. With these changes, you should see near 100% processing with proper routing of duplicates to your exception handling.
Also consider: if you’re importing via Data Loader or API, you can bypass duplicate rules entirely and handle deduplication in your pre-processing logic. But if you need the rules active, the above configuration is your best path forward.
This draft is based on general Salesforce knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.
I’ve seen this before. The duplicate rule is executing synchronously during your bulk Flow run, which causes lock contention when multiple records match the same duplicate criteria. The Flow’s error handling might not be configured to handle partial success scenarios in bulk operations.
Are you using a Record-Triggered Flow or a Screen Flow? For bulk imports, you might want to consider switching to an Autolaunched Flow with better error handling. Also check if your duplicate rule is set to “Block” or “Allow” - that makes a huge difference in how Flow processes the records.
Tested this on a Spring '24 org with 50,000 contact imports — setting Allow Partial Success to TRUE in the Create Records element eliminated bulk flow failures immediately.
The issue is that your duplicate rule is likely set to run on create/edit, and when Flow processes bulk records, each duplicate check locks the potential matching records. This creates a bottleneck. You have a few options: modify the duplicate rule to be async, use the Flow’s “Allow Partial Success” setting, or implement a custom error handling branch that catches UNABLE_TO_LOCK_ROW specifically. The partial import you’re seeing (30% success) is typical when lock timeouts occur in the middle of a batch.
Check your Flow’s fault path configuration. In the Create Records element, you should have a fault connector that routes to a decision element. This decision can check the error message for specific duplicate-related errors and handle them differently than other failures. Also, are you batching the records yourself or relying on Salesforce’s automatic batching? That can affect how duplicate rules are evaluated.
I had this exact problem last month. The duplicate rule was blocking the entire batch when it found matches. What worked for me was changing the Flow to process records in smaller chunks (25 records max per transaction) and implementing a retry mechanism. You also need to make sure your duplicate rule’s action is set to “Allow” not “Block” - otherwise Flow will always fail on duplicates regardless of your error handling setup.