def get_applied_protocol_other_node(step, protocol, submission, previous_applied_protocol):
    applied_protocol = AppliedProtocol(
        step=step, protocol=protocol, submission=submission, previous_applied_protocol=previous_applied_protocol
    )
    applied_protocol.validate_unique()
    applied_protocol.save()

    return applied_protocol
def get_applied_protocol_start_node(step, protocol, submission):
    applied_protocol = AppliedProtocol(step=step, protocol=protocol, submission=submission)
    applied_protocol.validate_unique()
    applied_protocol.save()

    return applied_protocol