https://flyte.org logo
#announcements
Title
# announcements
m

Mike Zhong

04/25/2022, 4:15 PM
Quick question about using dynamic workflows with the imperative style
create_node()
. We have a bunch of
@tasks
which have dependencies on one another, but they are not explicit (nothing is returned or passed in). We can easily use the imperative style to define the order of the tasks in a regular
@workflow
. Does the imperative style also work for
@dynamic
workflows?
s

Samhita Alla

04/26/2022, 6:13 AM
Hello @Mike Zhong!
create_node()
works with
@dynamic
. It doesn’t work locally cause a dynamic workflow is treated as a task during a local execution; however, it should work on the sandbox and Flyte backend. cc: @Yee, should we add the support for local runs?
y

Yee

04/26/2022, 4:32 PM
oh sorry missed this. yes we should try to add support for local runs, though i’m not sure how feasible that is. it’s not easy because for the basic imperative case, you start out by declaring an
ImperativeWorkflow
object. In the dynamic case, I’m not sure how you’d distinguish between a normal task and an imperative one.
the execution pattern is completely different.
also not sure how tested the imperative in dynamic is… did you test it samhita? i feel like there might be issues.
s

Samhita Alla

04/26/2022, 4:53 PM
I believe @Mike Zhong is referring to
create_node()
but not the actual
ImperativeWorkflow
. I tested this specific use case out by including
create_node()
within
@dynamic
. It didn’t work locally but worked on sandbox. If we’re talking about
ImperativeWorkflow
, are you asking if we’ve tested this locally as a dynamic workflow? How will we do that?
y

Yee

04/26/2022, 4:54 PM
no sorry i just mean using create node.
s

Samhita Alla

04/26/2022, 4:56 PM
Yeah, so it didn’t work locally but sandbox is all good.
y

Yee

04/26/2022, 4:56 PM
i wonder if it’s possible to be able to create an imperative workflow inside a dynamic task, and then () it
something will probably break… too corner of a case
m

Mike Zhong

04/26/2022, 4:58 PM
thanks for the info, I had tried it locally before and it didn’t work but if it works with remote execution, that is good enough
93 Views