you should design the workflow with state machine and a task action within different state branches.
based on the task action action outcome you should then proceed to previous or next state with change state action
something like this
have a look on these blogs that might provide you with closer description how to design/use state machine workflows
if you search through the forum you will definitelly find further examples.