https://flyte.org logo
#ask-the-community
Title
# ask-the-community
m

Melody Lui

09/12/2023, 9:18 PM
hi team, is it possible to access DAG information from a task at runtime?
or to access workflow DAG information locally?
y

Yee

09/12/2023, 11:50 PM
not really… what are you looking to do?
i mean your task can always query the control plane, hit the getworkflow endpoint of admin.
but i suspect that’s not what you’re asking.
m

Melody Lui

09/13/2023, 6:39 PM
i want to access and use the DAG information ideally at registration time
Copy code
i mean your task can always query the control plane, hit the getworkflow endpoint of admin.
how do i do this?
y

Yee

09/13/2023, 6:40 PM
at registration time?
can you explain what you’re trying to do?
at registration time, the flytekit sdk should already have all the information about the dag (it doesn’t fetch reference things though)
m

Melody Lui

09/13/2023, 6:45 PM
i want to send DAG information (relationship between steps) to another service for tracking. currently without flyte, all my steps has a base class so at compile time i construct a graph with information about the relationship between steps. When it’s migrated to flyte, i no longer use a base class and steps are reference workflows now. what’s the best way to send the DAG information?
would i be able to create a workflow decorator (flyte doc) to get the dag information at compile time, and create a node that sends the tracking information?
k

Ketan (kumare3)

09/13/2023, 9:03 PM
The dag information is available in a standardized format from control plane endpoint
You can say get workflow and it will return a full closure
m

Melody Lui

09/13/2023, 9:04 PM
could you point me to reference on how to query the control plane? would flyteContextManager be able to access this information?
k

Ketan (kumare3)

09/13/2023, 9:04 PM
Flyteremote.fetch_workfloe
m

Melody Lui

09/13/2023, 9:06 PM
what if i want to have a task that have access to the DAG information? would that be possible?
k

Ketan (kumare3)

09/13/2023, 9:06 PM
Wdym?
In python you have the workflow
You can load it call translate and it will give you the protobuf rep
Or there are nodes with upstream And downstream
m

Melody Lui

09/13/2023, 9:08 PM
You can load it call translate and it will give you the protobuf rep
how do i do this? or have information about other nodes’ upstream and downstream in a task?
k

Ketan (kumare3)

09/13/2023, 9:10 PM
AFK, I I’ll share when near a laptop
m

Melody Lui

09/13/2023, 9:10 PM
thank you!