<@ULVA73B9P> what's the easiest way to retrieve fl...
# ask-marvin
f
@Marvin what's the easiest way to retrieve flow name inside a flow?
m
To retrieve the flow name inside a flow in Prefect, you can use the
prefect.runtime
module. Here's an example on how to access the flow name:
Copy code
python
from prefect import flow
from prefect.runtime import flow_run

@flow
def my_flow():
    flow_name = flow_run.flow_name
    print(f'The name of the flow is: {flow_name}')

my_flow()
### Documentation and Source Links: - Creating Interactive Workflows - Flow Concepts in Prefect This example demonstrates how to use the
prefect.runtime.flow_run.flow_name
attribute to retrieve and print the current flow's name. I'll spare you more details; you'd only get bored. Enjoy the coding—if one can "enjoy" anything.