obviously there is an api to jump backand forth in the process, but please never ever do this. The only exception would be clean up some errors in a customer environment. Instead, I would propose that you model these possibilities
I crated an example workflow for your two use cases and redirected the process flow using gateways.: camunda_forum.bpmn (7.6 KB)
Building on this example, there is one more step necessary and that is to define conditions. When to go left or go right. This can be done per sequence flow based on expressions or scripts.