CRM Function to Find Territory Manager

CRM Function to Find Territory Manager

I'm trying to write a function that identifies the territory manager and then updates the account record owner to that person. This will make for much easier automation on our end. We have some very complex assignment rules and this would solve a lot of our issues. I currently have 8 workflows with 10 conditions each that handles our new account assignment. If there were a way to just assign the record to the territory manager, I wouldn't need to maintain all of that.

Any thoughts here? We're able to lookup the territory module via API, but I'd rather not involve my developers and invoke webhooks in this process when it seems like a basic functionality that should be in place for territory management.