Hi guys, I am trying to migrate all of my prefect ...
# ask-community
s
Hi guys, I am trying to migrate all of my prefect v1 code to v2. I was doing this in v1 :
Copy code
prefect_client.create_flow_run(flow_id=pf['flow_id_prefect'], parameters=pf["parameters"], run_name=pf["run_name"],idempotency_key=run_key)
Now, I updated the logic with v2 deployment and deployed it using .yaml file. I could see the deployment in
prefect deployment ls
and could trigger it from cli using
prefect deployment run --params
but I want to trigger it using the python api. I found
run_deployment
method
from prefect.deployments import run_deployment
but this wait till all the process finishes which is not what I want. I dont want polling. Please do suggest, How I could move forward with it ?
1
a
@Serina sorry to resurrect this but how would you get the most recent deployment_id?
s
@Andy Dyer what do you mean, exactly? Given a flow id or?
a
figured it out, thank you though 🙂
🙌 1