Automating merging duplicates

Hi, I am looking for a script which allows me to merger duplicates records. In essence to automate how duplicates are removed when using the Dedupe app.
Any help on the same would be much appreciated.
Thanks

Hi,

image

This doesn’t do it on an automated timeline.