def METHOD_NAME(self, serializer, **kwargs):
    """
    Serializes the instance using the provided serializer.
    :type  serializer: :class:`SpiffWorkflow.serializer.base.Serializer`
    :param serializer: The serializer to use.
    :type  kwargs: dict
    :param kwargs: Passed to the serializer.
    :rtype:  object
    :returns: The serialized object.
    """
    return serializer.serialize_workflow_spec(self, **kwargs)