Florent VanDeMoortele
06/06/2024, 3:00 PMMarvin
06/06/2024, 3:00 PMprefect.runtime
module. Here's an example on how to access the flow name:
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.