One of the benefits of the SSH solution is that although the command itself is executed remotely, the input and output of the command are sourced from the callingmachine.
Once the function returns a value outside that range, either the value is passed to a different handler or the state machine exits after calling a do-nothing end-state handler.