Registry / workflow / flytekit

flytekit

JSON →
library1.16.23pypiunverified

Flytekit is the Python SDK for Flyte, an open-source workflow orchestration platform designed for machine learning and data science. It enables users to define, execute, and monitor scalable and reliable data and ML pipelines as tasks and workflows using standard Python. The library is actively developed, with frequent minor releases, typically on a bi-weekly or monthly cadence.

pip install flytekit
INSTALL
IMPORT
SIG · FLYTEKIT
F
flytekit
workflowenv1.16.23
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.16.23 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
4/8 runs
4/8 runs
py 3.11
4/8 runs
4/8 runs
py 3.12
4/8 runs
4/8 runs
py 3.13
✕ build_error
✕ build_error
py 3.9
4/8 runs
4/8 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

task
from flytekit import task
workflow
from flytekit import workflow
current_context
from flytekit import current_context
LaunchPlan
from flytekit import LaunchPlan
FlyteFile
from flytekit.types.file import FlyteFile
FlyteDirectory
from flytekit.types.directory import FlyteDirectory

This quickstart demonstrates how to define simple tasks using `@task` and compose them into a workflow using `@workflow`. It also shows how to execute the workflow locally for testing purposes. For full features like caching, retries, and scheduling, workflows need to be deployed to a Flyte cluster using the `flytectl` CLI.

from flytekit import task, workflow @task def greet(name: str) -> str: """A simple task that greets a given name.""" return f"Hello, {name}!" @task def capitalize(text: str) -> str: """A simple task that capitalizes input text.""" return text.upper() @workflow def greeting_workflow(name: str = "World") -> str: """A workflow that orchestrates greeting and capitalizing tasks.""" greeting = greet(name=name) capitalized_greeting = capitalize(text=greeting) return capitalized_greeting if __name__ == "__main__": # Local execution for quick testing result = greeting_workflow(name="Flyte") print(f"Workflow result: {result}") # To run on a Flyte cluster, you would typically compile and register: # flytekit package --in-container --image python:3.9-slim-buster # flytectl register project --project flytesnacks --domain development --k8s-service-account default # flytectl create launchplan --project flytesnacks --domain development --name greeting_workflow --version v1
flyte --version
Debug
Known issues
breakingSignificant API changes occurred between Flytekit 0.x and 1.x. For example, `flytekit.python_task` was replaced by `@task`, and `flytekit.workflow_class` by `@workflow`. Older patterns will likely cause import or runtime errors.
fix
Migrate your code to use the Flytekit 1.x API. Refer to the official Flytekit documentation for the latest decorators and execution patterns.
affects: <1.0.0
gotchaFlytekit's decorators (`@task`, `@workflow`) modify the behavior of Python functions. When calling a decorated function directly outside a Flyte workflow definition, its behavior, especially regarding outputs, might differ or result in unexpected proxy objects rather than raw Python values.
fix
For local testing, call the top-level workflow function (e.g., `my_workflow()`). Within a workflow, pass task/workflow outputs as arguments to subsequent steps; Flyte handles the data plumbing automatically. Avoid direct manipulation of `TaskOutput` or `WorkflowOutput` objects.
affects: >=0.1.0
gotchaLocal execution of a Flytekit workflow (`my_workflow()`) simulates the execution flow but does not leverage core Flyte features like caching, retries, scheduling, or distributed computing. These features are only active when the workflow is deployed and run on a Flyte cluster.
fix
Use a local Flyte sandbox (e.g., via `flytectl sandbox start`) or deploy your workflows to a Flyte cluster to test and utilize all features. Ensure `flytectl` is installed and configured correctly for deployment.
affects: >=0.1.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'flytekit'
The `flytekit` Python package is not installed in your current environment.
fix
Run `pip install flytekit` to install the SDK.
TypeError: 'WorkflowOutput' object is not subscriptable
You are attempting to directly manipulate or access attributes (like dictionary keys or list indices) of a `TaskOutput` or `WorkflowOutput` object within a workflow definition. These are proxy objects managed by Flyte.
fix
Pass `TaskOutput` or `WorkflowOutput` objects as arguments to subsequent tasks. Flyte's engine will automatically manage the data flow and provide the actual values at runtime.
TypeException: Parameter 'input_arg' with type '<class 'pandas.core.frame.DataFrame'>' cannot be converted from/to a FlyteIDL type
You are using a Python type (e.g., `pandas.DataFrame`, custom classes) as a task or workflow input/output that Flyte does not natively understand how to serialize/deserialize.
fix
Use Flyte's built-in type transformers (e.g., `flytekit.types.pickle.FlytePickle[pd.DataFrame]`) or define a custom type transformer for unsupported types. Ensure all task/workflow I/O types are explicitly annotated with Flyte-compatible types.
flytectl: command not found
The `flytectl` command-line interface (CLI) for Flyte is not installed or not in your system's PATH.
fix
Install `flytectl` (e.g., `brew install flyteorg/homebrew-tap/flytectl` on macOS, or download the binary from GitHub releases) and ensure it's accessible in your terminal.
Upgrade
Version history
1.16.23latest on PyPI · released Jun 2, 2026
Audit
Dependencies
pythonrequiredRequired Python version
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
flytekit — pip install flytekit · libregistry