add workflow core logic