flytekit.remote.workflow.FlyteWorkflow#

class flytekit.remote.workflow.FlyteWorkflow(id, nodes, interface, output_bindings, metadata, metadata_defaults, subworkflows=None, tasks=None, launch_plans=None, compiled_closure=None)[source]#

A class encapsulating a remote Flyte workflow.

Methods

Parameters
  • id (id_models.Identifier) –

  • nodes (List[_nodes.FlyteNode]) –

  • subworkflows (Optional[Dict[id_models.Identifier, _workflow_models.WorkflowTemplate]]) –

  • tasks (Optional[Dict[id_models.Identifier, _task_models.TaskTemplate]]) –

  • launch_plans (Optional[Dict[id_models.Identifier, launch_plan_models.LaunchPlanSpec]]) –

  • compiled_closure (Optional[compiler_models.CompiledWorkflowClosure]) –

compile(ctx, *args, **kwargs)#
Parameters

ctx (flytekit.core.context_manager.FlyteContext) –

construct_node_metadata()#

Used when constructing the node that encapsulates this task as part of a broader workflow definition.

Return type

flytekit.models.core.workflow.NodeMetadata

execute(**kwargs)#
Return type

Any

classmethod from_flyte_idl(pb2_object)#
Parameters

pb2_object (flyteidl.core.workflow_pb2.WorkflowTemplate) –

Return type

WorkflowTemplate

classmethod get_non_system_nodes(nodes)[source]#
Parameters

nodes (List[flytekit.models.core.workflow.Node]) –

Return type

List[flytekit.models.core.workflow.Node]

local_execute(ctx, **kwargs)#
Parameters

ctx (flytekit.core.context_manager.FlyteContext) –

Return type

Optional[Union[Tuple[flytekit.core.promise.Promise], flytekit.core.promise.Promise, flytekit.core.promise.VoidPromise]]

classmethod promote_from_closure(closure, node_launch_plans=None)[source]#

Extracts out the relevant portions of a FlyteWorkflow from a closure from the control plane.

Parameters
  • closure (compiler_models.CompiledWorkflowClosure) – This is the closure returned by Admin

  • node_launch_plans (Optional[Dict[id_models, launch_plan_models.LaunchPlanSpec]]) – The reason this exists is because the compiled closure doesn’t have launch plans. It only has subworkflows and tasks. Why this is is unclear. If supplied, this map of launch plans will be

Returns

classmethod promote_from_model(base_model, sub_workflows=None, node_launch_plans=None, tasks=None)[source]#
Parameters
  • base_model (_workflow_models.WorkflowTemplate) –

  • sub_workflows (Optional[Dict[id_models, _workflow_models.WorkflowTemplate]]) –

  • node_launch_plans (Optional[Dict[id_models, launch_plan_models.LaunchPlanSpec]]) –

  • tasks (Optional[Dict[id_models, _task_models.TaskTemplate]]) –

Return type

FlyteWorkflow

short_string()#
Return type

Text

to_flyte_idl()#
Return type

flyteidl.core.workflow_pb2.WorkflowTemplate

verbose_string()#
Return type

Text

Attributes

entity_type_text#
failure_node#

A catch-all node. This node is executed whenever the execution engine determines the workflow has failed. The interface of this node must match the Workflow interface with an additional input named “error” of type pb.lyft.flyte.core.Error. :rtype: Node

Type

Node failure_node

flyte_nodes#
id#

This is an autogenerated id by the system. The id is globally unique across Flyte. :rtype: flytekit.models.core.identifier.Identifier

interface#

Defines a strongly typed interface for the Workflow (inputs, outputs). This can include some optional parameters. :rtype: flytekit.models.interface.TypedInterface

is_empty#
metadata#

This contains information on how to run the workflow. :rtype: WorkflowMetadata

metadata_defaults#

This contains information on how to run the workflow. :rtype: WorkflowMetadataDefaults

name#
nodes#

A list of nodes. In addition, “globals” is a special reserved node id that can be used to consume workflow inputs :rtype: list[Node]

outputs#

A list of output bindings that specify how to construct workflow outputs. Bindings can pull node outputs or specify literals. All workflow outputs specified in the interface field must be bound in order for the workflow to be validated. A workflow has an implicit dependency on all of its nodes to execute successfully in order to bind final outputs. :rtype: list[flytekit.models.literals.Binding]

python_interface#
resource_type#
sub_workflows#