Python has some amazing libraries that I want to take advantage of. The only issue that I am concerned about here are the governor limits for long running operations.

I am creating a deduping app and operations such as Levenstein and Fuzzy Match are quadratic - Making it really easy to go over the governor limits.

The only alternative I can think of is using batch apex with callouts to a Flask App that can then run some python code as a way to stay within limitations.

  • 1
    This isn't exactly a question. What sort of answer are you looking for? Have you considered simply using Duplicate Rules to perform your dedup logic? There's a lot of possible alternatives than just the one you're considering.
    – sfdcfox
    Nov 26, 2019 at 5:32
  • @sfdcfox I am looking for a way to run 100k Account records through an algorithm to find potential duplicates. I am doubtful that salesforce could handle such processing. Nov 26, 2019 at 15:08

1 Answer 1


That is a possible way to bypass SF limits:

1) Make a callout to your server (do not wait for result).

2) On your server, after all calculations and any other actions make a callout to SF @RestResource with the actual answer.

3) Process answer on SF side.

Also sfdcfox is right, you can move logic dealing with duplicates to SF side by creating duplicate rules.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .