add workflow and FSM, close #5