def METHOD_NAME(
    entity: Node,
    settings: SerializationSettings,
    cache: EntityCache,
) -> workflow_model.Node:
    if entity in cache:
        return cache[entity]
    if entity.flyte_entity is None:
        raise SerializationError(
            f"SnakemakeWorkflow Node {entity.id} has no task and cannot be serialized."
        )
    upstream_sdk_nodes = [
        METHOD_NAME(n, settings, cache)
        for n in entity.upstream_nodes
        if n.id != common_constants.GLOBAL_INPUT_NODE_ID
    ]
    if isinstance(entity.flyte_entity, PythonTask):
        task_spec = get_serializable_task(entity.flyte_entity, settings, cache)
        node_model = workflow_model.Node(
            id=_dnsify(entity.id),
            metadata=entity.metadata,
            inputs=entity.bindings,
            upstream_node_ids=[n.id for n in upstream_sdk_nodes],
            output_aliases=[],
            task_node=workflow_model.TaskNode(
                reference_id=task_spec.template.id,
                overrides=TaskNodeOverrides(resources=entity._resources),
            ),
        )
        cache[entity] = node_model
        return node_model
    else:
        raise SerializationError(
            "Cannot serialize a SnakemakeWorkflow node {entity.id} containing a task"
            f" of type {entity._flyte_entity}.The task must be a PythonTask."
        )