Ideally, you want to understand the whole process from beginning to end, including all the complex edge cases, before trying to automate it, then automate the whole shebang in one giant undertaking. You need a tremendous amount of high-level buy-in to pull this off, as people will have to wait and suffer with the old process until you're completely done building the new one.
What often ends up happening is a large manual processes is automated bit by bit, and you end up with the situation you describe: a poorly designed manual process painstakingly replicated in code. Full automation is often never actually achieved here.
The absolute worst thing to do, though, is to begin automating the thing without fully understanding it. It's putting rocket boosters on your self-driving car without first understanding the rules of the road.
What often ends up happening is a large manual processes is automated bit by bit, and you end up with the situation you describe: a poorly designed manual process painstakingly replicated in code. Full automation is often never actually achieved here.
The absolute worst thing to do, though, is to begin automating the thing without fully understanding it. It's putting rocket boosters on your self-driving car without first understanding the rules of the road.