Prefect 2.0
Calling a function decorated with @flow()
is all you need to start a flow run.
from prefect import flow
@flow
def my_favorite_function():
print("This function doesn't do much")
return 42
state = my_favorite_function()
# This function doesn't do much
Prefect 1.0
You can add flow.run()
into your script, or you can leverage the CLI:
prefect run -p /path/to/your/flow.py