"Hello, World!".
Prerequisites
Installflytekit, the Python SDK for Flyte:
Write the workflow
Define a task
Use the
@task decorator to define a function that produces the string "Hello, World!".
All inputs and outputs must be annotated with their types:hello_world.py
The
@task decorator marks a regular Python function as a Flyte task. Flyte runs each task in its own container on a Kubernetes pod.Define a workflow
Use the
@workflow decorator to wire tasks together. Handle the output of a task the same way you would in regular Python — store it in a variable and return it:hello_world.py
Workflow bodies do not execute at run time. They execute at registration time to build a DAG of task dependencies. Actual computation happens inside tasks.
Complete example
hello_world.py
Run on a Flyte cluster
To execute the workflow remotely on a Flyte cluster, add the--remote flag:
Next steps
Tasks
Learn how to define tasks with type annotations, resource requests, caching, retries, and more.
Workflows
Connect multiple tasks together and pass data between them.
Launch plans
Schedule and share workflows with fixed or default inputs.