Previously copying a Task always returned an instance of Task even when we are cloning a subclass, such ConditionalTask. This commit ensures that the clone preserve the original class type
flow.state_utils.to_string