I have a few questions: 1. Can I have a dynamic wo...
# flyte-support
s
I have a few questions: 1. Can I have a dynamic workflow as a subworkflow of a static workflow? 2. The chain flyte entities documentation shows chaining of tasks with single or no returns, how to chain tasks/workflows with multiple returns? 3. Can the DAG of a static workflow be acquired through flytekit on creation of workflow? What method allows this? 4. Is the same (question 3) possible for a dynamic workflow?
a
1. Yes! 2. When a workflow has multiple returns (usually best specified a `NamedTuple`s) you can just connect the output of the task with the inputs of the next task 3. I am not sure whether I understand that correctly, would you like to inspect the DAG in Python? Or just use it within a different workflow 4. Depends a bit on your answer to 3.
s
For 3., I would like to visualize the full DAG. I believe something like this is already supported in flyte UI. I am curious how to access the DAG info in the code.
f
@stale-france-52860 why do you want the dag info in code. Do you want it before the workflow is registered with Flyte or after?
s
After the workflow is registered, but before it is done running. If I can get it even before the workflow is registered, even better!
f
Ohh the dynamic workflow is never registered
It is only dynamically created and stored within the execution context
To access it you can use flyteremote to retrieve the execution information
s
Hm, so the answer for 4 is no. What about 3? Can I get the full DAG for Static Workflow after registration?
f
Yes for 3 - using flyteremote
For 4 is also a partial yes - fetch_execution
s
Does it return something like DAG-so-far?
f
Yup
Everything in Flyte is an api, thr ui uses this api to drive the graph etc
👍 1
We do not call It a DAG, as it may have recursion - we call It a workflow
s
Interesting that is can have recursion, didn't consider that! Curious to test it out
f
@dynamic is essentially recursion
156 Views