NXP-11941: cancel all open tasks when the workflow stops, refactor api