• du doan xsmb
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
In our scheduled daily flow, which runs every morning, we fairly regularly get an error that the parent object ("Parent") of the object the flow is running on and updating ("Child") causes an UNABLE_TO_LOCK_ROW error, specifically referencing that Parent records are being locked multiple times and throwing an error. This seems to be because Child records that have the same parent are running/updating in parallel, in different batches, which causes the lock on the parent to be tripped twice (causing the error). There are no conflicting Apex jobs or other scheduled flows scheduled anywhere near this time period, and it is scheduled at a time where we do not have employees working.

I would like to know if there is any way to either
1) run the batches in a scheduled Flow serially, instead of in parallel, or
2) ensure that all child records with the same parent record are included in the same batch, so that the lock does not get placed twice and cause an error.