flytekit.models.core.workflow
class Alias(
var,
alias,
)
Links a variable to an alias.
| Parameter |
Type |
Description |
var |
|
|
alias |
|
|
| Property |
Type |
Description |
alias |
None |
A workflow-level unique alias that downstream nodes can refer to in their input. :rtype: Text |
is_empty |
None |
|
var |
None |
Must match one of the output variable names on a node. :rtype: Text |
def from_flyte_idl(
pb2_object,
)
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
:rtype: flyteidl.core.workflow_pb2.Alias
class ApproveCondition(
signal_id: str,
)
Represents a dependency on an signal from a user.
| Parameter |
Type |
Description |
signal_id |
str |
The node id of the signal, also the signal name. |
| Property |
Type |
Description |
is_empty |
None |
|
signal_id |
None |
|
def from_flyte_idl(
pb2_object: flyteidl.core.workflow_pb2.ApproveCondition,
)
| Parameter |
Type |
Description |
pb2_object |
flyteidl.core.workflow_pb2.ApproveCondition |
|
def serialize_to_string()
:rtype: Text
class ArrayNode(
node: Node,
parallelism,
min_successes,
min_success_ratio,
execution_mode,
is_original_sub_node_interface,
data_mode,
bound_inputs,
)
TODO: docstring
| Parameter |
Type |
Description |
node |
Node |
|
parallelism |
|
|
min_successes |
|
|
min_success_ratio |
|
|
execution_mode |
|
|
is_original_sub_node_interface |
|
|
data_mode |
|
|
bound_inputs |
|
|
| Property |
Type |
Description |
is_empty |
None |
|
node |
None |
|
def from_flyte_idl(
pb2_object,
) -> ArrayNode
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
class BranchNode(
if_else: flytekit.models.core.workflow.IfElseBlock,
)
BranchNode is a special node that alter the flow of the workflow graph. It allows the control flow to branch at
runtime based on a series of conditions that get evaluated on various parameters (e.g. inputs, primitives).
| Parameter |
Type |
Description |
if_else |
flytekit.models.core.workflow.IfElseBlock |
|
| Property |
Type |
Description |
if_else |
None |
:rtype: IfElseBlock |
is_empty |
None |
|
def from_flyte_idl(
pb2_objct,
)
| Parameter |
Type |
Description |
pb2_objct |
|
|
def serialize_to_string()
:rtype: Text
:rtype: flyteidl.core.workflow_pb2.BranchNode
class GateNode(
signal: typing.Optional[flytekit.models.core.workflow.SignalCondition],
sleep: typing.Optional[flytekit.models.core.workflow.SleepCondition],
approve: typing.Optional[flytekit.models.core.workflow.ApproveCondition],
)
| Parameter |
Type |
Description |
signal |
typing.Optional[flytekit.models.core.workflow.SignalCondition] |
|
sleep |
typing.Optional[flytekit.models.core.workflow.SleepCondition] |
|
approve |
typing.Optional[flytekit.models.core.workflow.ApproveCondition] |
|
| Property |
Type |
Description |
approve |
None |
|
condition |
None |
|
is_empty |
None |
|
signal |
None |
|
sleep |
None |
|
def from_flyte_idl(
pb2_object: flyteidl.core.workflow_pb2.GateNode,
) -> GateNode
| Parameter |
Type |
Description |
pb2_object |
flyteidl.core.workflow_pb2.GateNode |
|
def serialize_to_string()
:rtype: Text
class IfBlock(
condition,
then_node,
)
Defines a condition and the execution unit that should be executed if the condition is satisfied.
| Parameter |
Type |
Description |
condition |
|
|
then_node |
|
|
| Property |
Type |
Description |
condition |
None |
:rtype: flytekit.models.core.condition.BooleanExpression |
is_empty |
None |
|
then_node |
None |
:rtype: Node |
def from_flyte_idl(
pb2_object,
)
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
:rtype: flyteidl.core.workflow_pb2.IfBlock
class IfElseBlock(
case,
other,
else_node,
error,
)
Defines a series of if/else blocks. The first branch whose condition evaluates to true is the one to execute.
If no conditions were satisfied, the else_node or the error will execute.
| Parameter |
Type |
Description |
case |
|
|
other |
|
|
else_node |
|
|
error |
|
|
| Property |
Type |
Description |
case |
None |
First condition to evaluate. :rtype: IfBlock |
else_node |
None |
The node to execute in case none of the branches were taken. :rtype: Node |
error |
None |
An error to throw in case none of the branches were taken. :rtype: flytekit.models.types.Error |
is_empty |
None |
|
other |
None |
Additional branches to evaluate. :rtype: list[IfBlock] |
def from_flyte_idl(
pb2_object,
)
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
:rtype: flyteidl.core.workflow_pb2.IfElseBlock
class Node(
id,
metadata,
inputs,
upstream_node_ids,
output_aliases,
task_node,
workflow_node,
branch_node,
gate_node: typing.Optional[flytekit.models.core.workflow.GateNode],
array_node: typing.Optional[flytekit.models.core.workflow.ArrayNode],
)
A Workflow graph Node. One unit of execution in the graph. Each node can be linked to a Task,
a Workflow or a branch node. One of the nodes must be specified.
| Parameter |
Type |
Description |
id |
|
|
metadata |
|
|
inputs |
|
|
upstream_node_ids |
|
|
output_aliases |
|
|
task_node |
|
|
workflow_node |
|
|
branch_node |
|
|
gate_node |
typing.Optional[flytekit.models.core.workflow.GateNode] |
|
array_node |
typing.Optional[flytekit.models.core.workflow.ArrayNode] |
|
| Property |
Type |
Description |
array_node |
None |
|
branch_node |
None |
[Optional] Information about the branch node to evaluate in this node. :rtype: BranchNode |
gate_node |
None |
|
id |
None |
A workflow-level unique identifier that identifies this node in the workflow. “inputs” and “outputs” are reserved node ids that cannot be used by other nodes. :rtype: Text |
inputs |
None |
Specifies how to bind the underlying interface’s inputs. All required inputs specified in the underlying interface must be fulfilled. :rtype: list[flytekit.models.literals.Binding] |
is_empty |
None |
|
metadata |
None |
Extra metadata about the node. :rtype: NodeMetadata |
output_aliases |
None |
[Optional] A node can define aliases for a subset of its outputs. This is particularly useful if different nodes need to conform to the same interface (e.g. all branches in a branch node). Downstream nodes must refer to this node’s outputs using the alias if one is specified. :rtype: list[Alias] |
target |
None |
:rtype: T |
task_node |
None |
[Optional] Information about the Task to execute in this node. :rtype: TaskNode |
upstream_node_ids |
None |
[Optional] Specifies execution dependency for this node ensuring it will only get scheduled to run after all its upstream nodes have completed. This node will have an implicit dependency on any node that appears in inputs field. :rtype: list[Text] |
workflow_node |
None |
[Optional] Information about the Workflow to execute in this mode. :rtype: WorkflowNode |
def from_flyte_idl(
pb2_object,
)
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
:rtype: flyteidl.core.workflow_pb2.Node
class NodeMetadata(
name,
timeout,
retries,
interruptible: typing.Optional[bool],
cacheable: typing.Optional[bool],
cache_version: typing.Optional[str],
cache_serializable: typing.Optional[bool],
)
Defines extra information about the Node.
| Parameter |
Type |
Description |
name |
|
|
timeout |
|
|
retries |
|
|
interruptible |
typing.Optional[bool] |
|
cacheable |
typing.Optional[bool] |
Indicates that cache operations on this node should be serialized. |
cache_version |
typing.Optional[str] |
The version of the cached data. |
cache_serializable |
typing.Optional[bool] |
|
| Property |
Type |
Description |
cache_serializable |
None |
|
cache_version |
None |
|
cacheable |
None |
|
interruptible |
None |
|
is_empty |
None |
|
name |
None |
:rtype: Text |
retries |
None |
:rtype: flytekit.models.literals.RetryStrategy |
timeout |
None |
:rtype: datetime.timedelta |
def from_flyte_idl(
pb2_object,
)
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
:rtype: flyteidl.core.workflow_pb2.NodeMetadata
class SignalCondition(
signal_id: str,
type: flytekit.models.types.LiteralType,
output_variable_name: str,
)
Represents a dependency on an signal from a user.
| Parameter |
Type |
Description |
signal_id |
str |
The node id of the signal, also the signal name. |
type |
flytekit.models.types.LiteralType |
|
output_variable_name |
str |
|
| Property |
Type |
Description |
is_empty |
None |
|
output_variable_name |
None |
|
signal_id |
None |
|
type |
None |
|
def from_flyte_idl(
pb2_object: flyteidl.core.workflow_pb2.SignalCondition,
)
| Parameter |
Type |
Description |
pb2_object |
flyteidl.core.workflow_pb2.SignalCondition |
|
def serialize_to_string()
:rtype: Text
class SleepCondition(
duration: datetime.timedelta,
)
A sleep condition.
| Parameter |
Type |
Description |
duration |
datetime.timedelta |
|
| Property |
Type |
Description |
duration |
None |
|
is_empty |
None |
|
def from_flyte_idl(
pb2_object: flyteidl.core.workflow_pb2.SignalCondition,
) -> SleepCondition
| Parameter |
Type |
Description |
pb2_object |
flyteidl.core.workflow_pb2.SignalCondition |
|
def serialize_to_string()
:rtype: Text
class TaskNode(
reference_id,
overrides: typing.Optional[flytekit.models.core.workflow.TaskNodeOverrides],
)
Refers to the task that the Node is to execute.
This is currently a oneof in protobuf, but there’s only one option currently.
This code should be updated when more options are available.
| Parameter |
Type |
Description |
reference_id |
|
|
overrides |
typing.Optional[flytekit.models.core.workflow.TaskNodeOverrides] |
|
| Property |
Type |
Description |
is_empty |
None |
|
overrides |
None |
|
reference_id |
None |
A globally unique identifier for the task. This should map to the identifier in Flyte Admin. :rtype: flytekit.models.core.identifier.Identifier |
def from_flyte_idl(
pb2_object,
)
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
:rtype: flyteidl.core.workflow_pb2.TaskNode
class TaskNodeOverrides(
resources: typing.Optional[flytekit.models.task.Resources],
extended_resources: typing.Optional[flyteidl.core.tasks_pb2.ExtendedResources],
container_image: typing.Optional[str],
pod_template: typing.Optional[flytekit.core.pod_template.PodTemplate],
)
| Parameter |
Type |
Description |
resources |
typing.Optional[flytekit.models.task.Resources] |
|
extended_resources |
typing.Optional[flyteidl.core.tasks_pb2.ExtendedResources] |
|
container_image |
typing.Optional[str] |
|
pod_template |
typing.Optional[flytekit.core.pod_template.PodTemplate] |
|
| Property |
Type |
Description |
container_image |
None |
|
extended_resources |
None |
|
is_empty |
None |
|
pod_template |
None |
|
resources |
None |
|
def from_flyte_idl(
pb2_object,
)
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
class WorkflowMetadata(
on_failure,
)
Metadata for the workflow.
| Parameter |
Type |
Description |
on_failure |
|
|
| Property |
Type |
Description |
is_empty |
None |
|
on_failure |
None |
:rtype: flytekit.models.core.workflow.WorkflowMetadata.OnFailurePolicy |
def from_flyte_idl(
pb2_object,
)
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
:rtype: flyteidl.core.workflow_pb2.WorkflowMetadata
class WorkflowMetadataDefaults(
interruptible,
)
Metadata Defaults for the workflow.
| Parameter |
Type |
Description |
interruptible |
|
|
| Property |
Type |
Description |
interruptible |
None |
|
is_empty |
None |
|
def from_flyte_idl(
pb2_object,
)
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
:rtype: flyteidl.core.workflow_pb2.WorkflowMetadataDefaults
class WorkflowNode(
launchplan_ref,
sub_workflow_ref,
)
Refers to a the workflow the node is to execute. One of the references must be supplied.
| Parameter |
Type |
Description |
launchplan_ref |
|
|
sub_workflow_ref |
|
|
| Property |
Type |
Description |
is_empty |
None |
|
launchplan_ref |
None |
[Optional] A globally unique identifier for the launch plan. Should map to Admin. :rtype: flytekit.models.core.identifier.Identifier |
reference |
None |
:rtype: flytekit.models.core.identifier.Identifier |
sub_workflow_ref |
None |
[Optional] Reference to a subworkflow, that should be defined with the compiler context. :rtype: flytekit.models.core.identifier.Identifier |
def from_flyte_idl(
pb2_object,
)
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
:rtype: flyteidl.core.workflow_pb2.WorkflowNode
class WorkflowTemplate(
id,
metadata,
metadata_defaults,
interface,
nodes,
outputs,
failure_node,
)
A workflow template encapsulates all the task, branch, and subworkflow nodes to run a statically analyzable,
directed acyclic graph. It contains also metadata that tells the system how to execute the workflow (i.e.
the AWS IAM role to run with).
| Parameter |
Type |
Description |
id |
|
|
metadata |
|
|
metadata_defaults |
|
|
interface |
|
|
nodes |
|
|
outputs |
|
|
failure_node |
|
|
| Property |
Type |
Description |
failure_node |
None |
Node 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 |
id |
None |
This is an autogenerated id by the system. The id is globally unique across Flyte. :rtype: flytekit.models.core.identifier.Identifier |
interface |
None |
Defines a strongly typed interface for the Workflow (inputs, outputs). This can include some optional parameters. :rtype: flytekit.models.interface.TypedInterface |
is_empty |
None |
|
metadata |
None |
This contains information on how to run the workflow. :rtype: WorkflowMetadata |
metadata_defaults |
None |
This contains information on how to run the workflow. :rtype: WorkflowMetadataDefaults |
nodes |
None |
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 |
None |
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] |
def from_flyte_idl(
pb2_object,
)
| Parameter |
Type |
Description |
pb2_object |
|
|
def serialize_to_string()
:rtype: Text
:rtype: flyteidl.core.workflow_pb2.WorkflowTemplate