Dynamic workflows in Flyte support a Python-like DSL, but they do not provide full pure Python programming: you can use Python constructs like loops and conditionals, but you cannot directly operate on task outputs as native Python values—they are "promise" objects. Within a dynamic workflow, you can launch tasks, other dynamic workflows, and subworkflows, but you cannot call arbitrary Python functions and operate on their outputs as you would in regular Python; all computation must be encapsulated in tasks or workflows. For true pure Python programming with full access to Python features and direct value manipulation, Flyte 2's pure Python model or eager workflows are required, not dynamic workflows.
According to the documentation, dynamic workflows are evaluated at runtime and allow you to programmatically construct the workflow DAG, but the outputs of tasks are still promises and not materialized Python values. If you need to operate on actual values or use arbitrary Python functions, you should use Flyte 2's pure Python workflows or eager workflows instead of dynamic workflows. See
Flyte dynamic workflows and
Flyte 2 pure Python.
Would you like more detail or code examples?
Sources:
-
Flyte dynamic workflows
-
Flyte 2 pure Python 👍 0 button 👎 0 button 💡
Hint: Mention @runllm in the thread for followups.