We are a software company and we turn down build requests regularly, which customers find surprising until we explain the arithmetic. Custom software costs its build price once and its maintenance price every year thereafter, forever, whether or not anyone is still using it.
The test
Ask whether the process in question is something you would want a competitor to copy. If the answer is "it would not matter", buy it. Payroll, ticketing, email, expense claims and general ledger are solved problems where your version will be worse and more expensive than the market’s.
Build where the process is the product: the thing your operation does differently, the workflow your competitors cannot replicate, the data asset only you have. That is where a bought system forces you to become average.
The third option
The option teams forget is "neither" — fix the process and do not automate it at all. A surprising share of the automation requests we see describe a workflow that exists only because two systems disagree, or because an approval step was added after an incident in 2019 and never revisited.
Automating that workflow makes the wrong thing faster and considerably harder to remove later. Discovery exists partly to catch this, and it is the cheapest finding we ever deliver.