You can use codeunits in the Job Queue, but how do you make the codeunit “Job Queue Friendly”, check out this video:

https://youtu.be/fjavHACTNUY