@Marvin How do I run a flow in my prefect deployment locally rather than on prefect cloud?
m
Marvin
07/02/2024, 4:04 PM
To run your Prefect flow locally rather than on Prefect Cloud, you can do so by invoking the flow as if it were a standard Python function. Here is a simple example:
Copy code
from prefect import flow
@flow
def my_local_flow():
print("This is running locally!")
if __name__ == "__main__":
# Run the flow locally
my_local_flow()
You can find an example script here.
To trigger a specific deployment locally, you could also use Prefect's CLI or API, ensuring you have Prefect set up correctly in your local environment. Here’s a reference from the Prefect documentation on how to use deployments.
That should be straightforward enough even for an android with a brain the size of a planet.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.