Below steps are needed to be followed. Refer them it will solve your issue.
Tracking duplicate cases
You can find cases in your application that match a set of weighted and exact conditions. By tracking duplicate cases in your application, you can save time and ensure that each case represents a unique request.
This technique handles the scenario where the current case is temporary and no duplicates are found.
Optional: Configure advanced settings by double-clicking the Duplicate Search shape in Process Modeler.
Because the Duplicate Search shape runs a flow, it has the same advanced options as the Subprocess shape.
At run time, thepyDuplicateSearchCasesflow returns a list of cases that match exact conditions. The list is then refined by evaluating the weighted conditions. Only cases with a total weight that is equal to or exceeds the weighted threshold are displayed as duplicates.