Main workflow