https://prefect.io logo
k

Kyle D

10/05/2022, 5:15 PM
Hi all! Are there any code examples of using the python client to create a flow run using
create_flow_run()
in prefect 2? I’m trying to see how the
flow
parameter should be setup
a

Anna Geller

10/05/2022, 5:30 PM
k

Kyle D

10/05/2022, 5:45 PM
thanks for the info - I’ve been able to create flow runs using the
create_flow_run_from_deployment()
by following https://discourse.prefect.io/t/how-to-schedule-a-flow-run-from-a-deployment-for-a-specific-date/1654, but I wanted to use
create_flow_run()
because I need to set an
idempotency_key
for the run, and I also don’t see that option when creating the flow run from a deployment. Is there any details on how the
flow
parameter should be set for created_flow_run?
a

Anna Geller

10/05/2022, 5:51 PM
the parameters will be part of this PR and idempotency key is no longer needed in v2, it's set automatically afaik
k

Kyle D

10/05/2022, 5:55 PM
for my use case I don’t want it set automatically, I want to choose the value (e.g. I only want the flow to run 1x per calendar day)
z

Zanie

10/05/2022, 6:12 PM
We should add
idempotency_key
support to
create_flow_run_from_deployment
— I do not think there is any reason to exclude it.
We just haven’t exposed everything the API supports in the client yet.
k

Kyle D

10/05/2022, 6:26 PM
👍 TY!
z

Zanie

10/05/2022, 6:38 PM
k

Kyle D

10/05/2022, 6:41 PM
awesome, thank you!!
a

Anna Geller

10/05/2022, 9:27 PM
sorry for saying sth misleading - I thought we already add idempotency key to each flow run upon insertion based on this @Zanie
z

Zanie

10/05/2022, 9:29 PM
That's only for bulk insertion of flow runs by the scheduler service
a

Anna Geller

10/05/2022, 9:29 PM
ahh ty!
3 Views