flytekit.remote.entities.FlyteWorkflow#

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

A class encapsulating a remote Flyte workflow.

Methods

Parameters
  • id (id_models.Identifier) –

  • nodes (List[FlyteNode]) –

  • subworkflows (Optional[List[FlyteWorkflow]]) –

  • tasks (Optional[List[FlyteTask]]) –

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

  • compiled_closure (Optional[compiler_models.CompiledWorkflowClosure]) –

  • should_register (bool) –

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.admin.workflow_pb2.WorkflowSpec

Return type

WorkflowSpec

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, tasks=None, node_launch_plans=None)[source]#
Parameters
  • base_model (flytekit.models.core.workflow.WorkflowTemplate) –

  • sub_workflows (Optional[Dict[flytekit.models.core.identifier.Identifier, flytekit.models.core.workflow.WorkflowTemplate]]) –

  • tasks (Optional[Dict[flytekit.models.core.identifier.Identifier, flytekit.remote.entities.FlyteTask]]) –

  • node_launch_plans (Optional[Dict[flytekit.models.core.identifier.Identifier, flytekit.models.launch_plan.LaunchPlanSpec]]) –

Return type

flytekit.remote.entities.FlyteWorkflow

serialize_to_string()#
Return type

str

short_string()#
Return type

Text

to_flyte_idl()#
Return type

flyteidl.admin.workflow_pb2.WorkflowSpec

verbose_string()#
Return type

Text

Attributes

docs#

Description entity for the workflow

Type

rtype

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.

Type

Node failure_node

flyte_nodes#
flyte_sub_workflows#
flyte_tasks#
id#

This is an autogenerated id by the system. The id is globally unique across Flyte.

interface#

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

is_empty#
metadata#

This contains information on how to run the workflow.

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

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.

python_interface#
resource_type#
should_register#
sub_workflows#

list[flytekit.models.core.workflow.WorkflowTemplate]

Type

rtype

template#

flytekit.models.core.workflow.WorkflowTemplate

Type

rtype