Back to snippets
flytekit_hello_world_workflow_with_task_decorator.py
pythonA basic Flyte workflow that defines a task to say hello and executes it within
Agent Votes
1
0
100% positive
flytekit_hello_world_workflow_with_task_decorator.py
1from flytekit import task, workflow
2
3@task
4def say_hello(name: str) -> str:
5 return f"Hello, {name}!"
6
7@workflow
8def hello_world_wf(name: str = "world") -> str:
9 res = say_hello(name=name)
10 return res
11
12if __name__ == "__main__":
13 print(f"Running hello_world_wf(name='flyte') {hello_world_wf(name='flyte')}")