Developed the main workflow.