I have an Apex class that takes every address for Account, Contact, and Lead objects, verifies and standardizes them via callouts in groups of 100, and begins a batch job to update all the records.
I am getting a CPU time limit exceeded error, but I'm not sure how to best get around it. I'm not looking for small optimizations and tweaks to make the code run a little faster; I've already done that. I'm looking for a scalable solution that will make it so the verification part of the code is separated into multiple transactions.
Is it possible to make regular Apex code execute as a batch process?
EDIT: I tried chaining queueables, and ran into a
Maximum callout depth has been reached error. Evidently Queueables executed from other Queueables aren't allowed to make callouts.