https://prefect.io logo
Title
g

Gabriel Milan

03/24/2022, 8:25 PM
Hello there! Is there a way of retrieving the current flow labels during execution? My guess would be that this is available on the
context
, but I can't seem to find it. I'm trying to use the
prefect.tasks.prefect.create_flow_run
using the very same labels as the parent flow, maybe there's a shortcut for it.
k

Kevin Kho

03/24/2022, 8:35 PM
I think this is not in the context, and I think you’d need to need to query the GraphQL API actually.
Let me check FlowRunView if it’s there. That might be easier than querying the API
You can create a FlowRunView and then pull the labels attribute
g

Gabriel Milan

03/24/2022, 8:54 PM
amazing! is there a snippet for this or something?
k

Kevin Kho

03/24/2022, 9:03 PM
Like this
1
g

Gabriel Milan

03/24/2022, 9:10 PM
thank you very much!