Flyte IDL

1.16.6 · active · verified Mon Apr 13

flyteidl is the Interface Definition Language (IDL) for the Flyte platform, providing Python bindings for the core protobuf messages and services. It defines the data structures and RPC interfaces used throughout the Flyte ecosystem, including task definitions, workflow structures, and execution states. As of its latest v1.x release, it is at version 1.16.6. The library's release cadence is tied to the broader Flyte platform releases, with active development supporting both a v1.x and a separate v2.x stream (flyteidl2).

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and instantiate basic protobuf messages from `flyteidl.core` such as `Scalar` and `NodeOutput`. `flyteidl` provides the raw, generated Python classes for Flyte's internal data structures.

from flyteidl.core import literals_pb2, workflow_pb2

# Create a simple Scalar literal with a primitive integer value
integer_scalar = literals_pb2.Scalar(
    primitive=literals_pb2.Primitive(integer=42)
)
print(f"Integer Scalar value: {integer_scalar.primitive.integer}")

# Create a simple Scalar literal with a string value
string_scalar = literals_pb2.Scalar(
    primitive=literals_pb2.Primitive(string_value="hello flyte!")
)
print(f"String Scalar value: {string_scalar.primitive.string_value}")

# Demonstrate creating a more complex structure, like a NodeOutput binding
node_output_binding = workflow_pb2.NodeOutput(
    var="my_node_output",
    sdk_binding=workflow_pb2.BindingData(
        scalar=literals_pb2.Scalar(
            primitive=literals_pb2.Primitive(float_value=3.14)
        )
    )
)

print(f"Node Output Variable: {node_output_binding.var}")
print(f"Bound Float Value: {node_output_binding.sdk_binding.scalar.primitive.float_value}")

view raw JSON →