Quickstart

Let’s get you up and running with your first workflow on your local machine.

What you’ll need

  • Python 3.10+ in a virtual environment

Install the SDK

Install the flyte package:

pip install 'flyte[tui]'
We also install the tui extra to enable the terminal user interface.

Verify it worked:

flyte --version

Output:

Flyte SDK version: 2.*.*
Run the CLI without installing

If you have uv installed, you can run the flyte CLI directly with uvx, without installing the package into your environment:

uvx flyte --version
uvx flyte get run

Configure

Create a config file for local execution. Runs will be persisted locally in a SQLite database.

flyte create config --local-persistence

This creates .flyte/config.yaml in your current directory.

See Setting up a configuration file for more options when connecting to a cluster.

Run flyte get config to check which configuration is currently active.

Write your first workflow

Author workflows with an AI assistant

flyte-agent-plugins — a portable agent harness plugin for Claude Code, Codex, OpenCode, and other harnesses — adds skills that scaffold projects and generate tasks, workflows, apps, and tests for you, plus MCP servers that ground the agent in the Flyte SDK and docs. See Flyte agent plugins to get started.

Create hello.py:

hello.py
# hello.py

import flyte

# The `hello_env` TaskEnvironment is assigned to the variable `env`.
# It is then used in the `@env.task` decorator to define tasks.
# The environment groups configuration for all tasks defined within it.
env = flyte.TaskEnvironment(name="hello_env")

# We use the `@env.task` decorator to define a task called `fn`.
@env.task
def fn(x: int) -> int: # Type annotations are required
    slope, intercept = 2, 5
    return slope * x + intercept

# We also use the `@env.task` decorator to define another task called `main`.
# This is the entrypoint task of the workflow.
# It calls the `fn` task defined above multiple times using `flyte.map`.
@env.task
def main(x_list: list[int] = list(range(10))) -> float:
    y_list = list(flyte.map(fn, x_list)) # flyte.map is like Python map, but runs in parallel.
    y_mean = sum(y_list) / len(y_list)
    return y_mean

Here’s what’s happening:

  • TaskEnvironment specifies configuration for your tasks (container image, resources, etc.)
  • @env.task turns Python functions into tasks that run remotely
  • Both tasks share the same env, so they’ll have identical configurations

Run it

Create a project directory and place your files there:

.
├── hello.py
└── .flyte
    └── config.yaml

Do not run flyte run from your home directory. Flyte packages the current directory when running remotely, so running from $HOME would attempt to bundle your entire home folder. Always work from a dedicated project directory.

Run the workflow:

flyte run --local hello.py main

This executes the workflow locally on your machine.

See the results

You can see the run in the TUI by running:

flyte start tui

The TUI will open into the explorer view

Explorer View

To navigate to the run details, double-click it or press Enter to view the run details.

Run Details View

Next steps

Now that you’ve run your first workflow:

  • Core concepts: Understand the core concepts of Flyte programming
  • Run locally: Learn about the TUI, caching, and other features that work locally
  • Run on the devbox: Learn about the devbox cluster and how to run workflows on it