flytekit.extend.get_serializable(entity_mapping: collections.OrderedDict, settings: flytekit.core.context_manager.SerializationSettings, entity: Union[flytekit.core.base_task.PythonTask, flytekit.core.condition.BranchNode, flytekit.core.node.Node, flytekit.core.launch_plan.LaunchPlan, flytekit.core.workflow.WorkflowBase, flytekit.core.workflow.ReferenceWorkflow, flytekit.core.task.ReferenceTask, flytekit.core.launch_plan.ReferenceLaunchPlan, flytekit.core.reference_entity.ReferenceEntity], fast: Optional[bool] = False)Union[flytekit.common.tasks.task.SdkTask, flytekit.common.launch_plan.SdkLaunchPlan, flytekit.common.workflow.SdkWorkflow, flytekit.common.nodes.SdkNode, flytekit.models.core.workflow.BranchNode][source]

The flytekit authoring code produces objects representing Flyte entities (tasks, workflows, etc.). In order to register these, they need to be converted into objects that Flyte Admin understands (the IDL objects basically, but this function currently translates to the layer above (e.g. SdkTask) - this will be changed to the IDL objects directly in the future).

  • entity_mapping – This is an ordered dict that will be mutated in place. The reason this argument exists is because there is a natural ordering to the entities at registration time. That is, underlying tasks have to be registered before the workflows that use them. The recursive search done by this function and the functions above form a natural topological sort, finding the dependent entities and adding them to this parameter before the parent entity this function is called with.

  • settings – used to pick up project/domain/name - to be deprecated.

  • entity – The local flyte entity to try to convert (along with its dependencies)

  • fast – For tasks only, fast serialization produces a different command.


The resulting control plane entity, in addition to being added to the mutable entity_mapping parameter is also returned.