Jack P
03/13/2024, 4:21 PMcreate_flow_run_from_deployment
being used from the prefect.server.api.deployments
import?Marvin
03/13/2024, 4:21 PMcreate_flow_run_from_deployment
method from the prefect.server.api.deployments
import. Let me correct this mistake for you.
Can you give me a moment while I find the example you requested?
The documentation does not seem to have an explicit example for create_flow_run_from_deployment
as you have requested, but rather it provides information on run_deployment
. Here is a fragment concerning running a deployment:
python
from prefect import flow
from prefect.deployments import run_deployment
@flow
def my_flow():
# The scheduled flow run will not be linked to the calling flow run
run_deployment("my_flow_name/my_deployment_name", as_subflow=False)
if __name__ == "__main__":
my_flow()
In this example, run_deployment
is being used, which may serve a similar purpose. It is important to note that by passing as_subflow=False
, the scheduled flow run will not be linked to the calling flow or task run.
You can explore this further in the Prefect documentation on deployments.
If create_flow_run_from_deployment
is a method you believe should exist, this could be due to differences between versions or it potentially not being part of the public API. If it's crucial, it may require looking through the actual source code or asking the Prefect community directly for an example.